From 8b4e474e44775f693e8690618ceacd24b45fccdf Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sat, 6 Mar 2021 15:26:30 +0000 Subject: [PATCH] no double tracebacks --- CHANGELOG.md | 3 ++- rich/logging.py | 2 +- rich/pretty.py | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d972e4a07..15f3deac1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [9.13.0] - Unreleased +## [9.13.0] - 2021-03-06 ### Added @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed Syntax background https://github.com/willmcgugan/rich/issues/1088 +- Fix for double tracebacks when no formatter https://github.com/willmcgugan/rich/issues/1079 ### Changed diff --git a/rich/logging.py b/rich/logging.py index c2e17a0fa..bdb8a5843 100644 --- a/rich/logging.py +++ b/rich/logging.py @@ -114,7 +114,6 @@ def get_level_text(self, record: LogRecord) -> Text: def emit(self, record: LogRecord) -> None: """Invoked by logging.""" message = self.format(record) - traceback = None if ( self.rich_tracebacks @@ -136,6 +135,7 @@ def emit(self, record: LogRecord) -> None: locals_max_length=self.locals_max_length, locals_max_string=self.locals_max_string, ) + message = record.getMessage() if self.formatter: record.message = record.getMessage() formatter = self.formatter diff --git a/rich/pretty.py b/rich/pretty.py index 3f2a1b786..445e11f92 100644 --- a/rich/pretty.py +++ b/rich/pretty.py @@ -439,7 +439,6 @@ def to_repr(obj: Any) -> str: def _traverse(obj: Any, root: bool = False) -> Node: """Walk the object depth first.""" obj_type = type(obj) - print(obj.__repr__.__qualname__) py_version = (sys.version_info.major, sys.version_info.minor) if ( is_dataclass(obj)