Skip to content

Commit 9950cf9

Browse files
Fix condition check for exception_exclude (avoid of that the exception's __bool__ return False)
1 parent fa991ad commit 9950cf9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/traceback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def _add_exception_note(exc_type, exc_value, exc_tb, where,
269269
tb_tuple = _traceback_to_tuples(exc_tb)
270270
if tb_tuple not in _seen._seen and _seen.times <= _ADD_EXC_NOTE_LIMIT:
271271
_seen._seen.add(tb_tuple)
272-
if exception_exclude:
272+
if exception_exclude is not None:
273273
_remove_exception(exc_value, exception_exclude)
274274
msg = "".join(TracebackException(exc_type, exc_value, exc_tb).format())
275275
while msg.endswith("\n") or msg.endswith(" "):

0 commit comments

Comments
 (0)