diff options
author | Zane Bitter <zbitter@redhat.com> | 2017-10-17 21:29:39 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-10-17 21:29:39 (GMT) |
commit | de86073a761cd3539aaca6f886a1f55effc0d9da (patch) | |
tree | 8277693d0d29d8b9cbe06449c9d048fb0aadfe9b /Lib/traceback.py | |
parent | 191e3138200906e43cba9347177914325b54843f (diff) | |
download | cpython-de86073a761cd3539aaca6f886a1f55effc0d9da.zip cpython-de86073a761cd3539aaca6f886a1f55effc0d9da.tar.gz cpython-de86073a761cd3539aaca6f886a1f55effc0d9da.tar.bz2 |
bpo-28603: Fix formatting tracebacks for unhashable exceptions (#4014)
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index fb3bce1..ee8c739 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -458,11 +458,11 @@ class TracebackException: # Handle loops in __cause__ or __context__. if _seen is None: _seen = set() - _seen.add(exc_value) + _seen.add(id(exc_value)) # Gracefully handle (the way Python 2.4 and earlier did) the case of # being called with no type or value (None, None, None). if (exc_value and exc_value.__cause__ is not None - and exc_value.__cause__ not in _seen): + and id(exc_value.__cause__) not in _seen): cause = TracebackException( type(exc_value.__cause__), exc_value.__cause__, @@ -474,7 +474,7 @@ class TracebackException: else: cause = None if (exc_value and exc_value.__context__ is not None - and exc_value.__context__ not in _seen): + and id(exc_value.__context__) not in _seen): context = TracebackException( type(exc_value.__context__), exc_value.__context__, |