summaryrefslogtreecommitdiffstats
path: root/Lib/traceback.py
diff options
context:
space:
mode:
authorIrit Katriel <iritkatriel@yahoo.com>2021-02-23 14:58:47 (GMT)
committerGitHub <noreply@github.com>2021-02-23 14:58:47 (GMT)
commit26f18b8540b49d592af66361f8df1a03953d1768 (patch)
treeb66c33940549691dfb3d35d560e20ce79dc8cb96 /Lib/traceback.py
parent7bb1cafa4e3d648669212ea4c6d11d6eafc6da23 (diff)
downloadcpython-26f18b8540b49d592af66361f8df1a03953d1768.zip
cpython-26f18b8540b49d592af66361f8df1a03953d1768.tar.gz
cpython-26f18b8540b49d592af66361f8df1a03953d1768.tar.bz2
bpo-43146: fix regression in traceback.print_exception(None) (GH-24463)
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r--Lib/traceback.py4
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