Skip to content

Commit 667cc76

Browse files
Update traceback.py
1 parent 283628d commit 667cc76

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Lib/traceback.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,8 +1195,10 @@ def __init__(self, exc_type, exc_value, exc_traceback, *, limit=None,
11951195
original__notes__ = [
11961196
f"Ignored error getting __notes__: {_safe_string(e, '__notes__', repr, exception_target, exc_value)}"
11971197
]
1198-
if original__notes__ is not None and not isinstance(
1199-
original__notes__, list):
1198+
if original__notes__ is not None and not (
1199+
isinstance(original__notes__, collections.abc.Sequence)
1200+
and not isinstance(original__notes__, (str, bytes))
1201+
):
12001202
original__notes__ = [
12011203
_safe_string(
12021204
original__notes__,

0 commit comments

Comments
 (0)