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 090465a..dfb296c 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -528,7 +528,9 @@ class TracebackException: cause = None if compact: - need_context = cause is None and not e.__suppress_context__ + need_context = (cause is None and + e is not None and + not e.__suppress_context__) else: need_context = True if (e and e.__context__ is not None |