diff options
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index 61c9fb5..02edeb6 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -453,6 +453,7 @@ class TracebackException: _seen=_seen) else: context = None + self.exc_traceback = exc_traceback self.__cause__ = cause self.__context__ = context self.__suppress_context__ = \ @@ -561,6 +562,7 @@ class TracebackException: not self.__suppress_context__): yield from self.__context__.format(chain=chain) yield _context_message - yield 'Traceback (most recent call last):\n' + if self.exc_traceback is not None: + yield 'Traceback (most recent call last):\n' yield from self.stack.format() yield from self.format_exception_only() |