Skip to content

Commit 8353e41

Browse files
Update traceback.py
1 parent 667cc76 commit 8353e41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/traceback.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ def __init__(self, exc_type, exc_value, exc_traceback, *, limit=None,
11931193
original__notes__ = getattr(exc_value, "__notes__", None)
11941194
except Exception as e:
11951195
original__notes__ = [
1196-
f"Ignored error getting __notes__: {_safe_string(e, '__notes__', repr, exception_target, exc_value)}"
1196+
f"Ignored error getting __notes__: {_safe_string(e, '__notes__', repr, exception_target, e)}"
11971197
]
11981198
if original__notes__ is not None and not (
11991199
isinstance(original__notes__, collections.abc.Sequence)
@@ -1209,7 +1209,7 @@ def __init__(self, exc_type, exc_value, exc_traceback, *, limit=None,
12091209
)
12101210
]
12111211
final_string_list = []
1212-
if original__notes__:
1212+
if original__notes__ is not None: # avoid that __bool__ raise Exception
12131213
for i in original__notes__:
12141214
final_string_list.append(
12151215
_safe_string(

0 commit comments

Comments
 (0)