Skip to content

Commit 8ea23f3

Browse files
committed
Fix suppression of exception chaining with 'from None'
Closes ipythongh-8618
1 parent 48aac09 commit 8ea23f3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

IPython/core/ultratb.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,8 @@ def get_chained_exception(exception_value):
985985
cause = getattr(exception_value, '__cause__', None)
986986
if cause:
987987
return cause
988+
if getattr(exception_value, '__suppress_context__', False):
989+
return None
988990
return getattr(exception_value, '__context__', None)
989991

990992
chained_evalue = get_chained_exception(evalue)

0 commit comments

Comments
 (0)