summaryrefslogtreecommitdiff
path: root/Lib/idlelib/run.py
diff options
context:
space:
mode:
authorZane Bitter <zbitter@redhat.com>2017-10-17 17:29:39 -0400
committerSerhiy Storchaka <storchaka@gmail.com>2017-10-18 00:29:39 +0300
commitde86073a761cd3539aaca6f886a1f55effc0d9da (patch)
tree8277693d0d29d8b9cbe06449c9d048fb0aadfe9b /Lib/idlelib/run.py
parent191e3138200906e43cba9347177914325b54843f (diff)
downloadcpython-git-de86073a761cd3539aaca6f886a1f55effc0d9da.tar.gz
bpo-28603: Fix formatting tracebacks for unhashable exceptions (#4014)
Diffstat (limited to 'Lib/idlelib/run.py')
-rw-r--r--Lib/idlelib/run.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index 39e0c116f9..6440e673bf 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -203,16 +203,16 @@ def print_exception():
seen = set()
def print_exc(typ, exc, tb):
- seen.add(exc)
+ seen.add(id(exc))
context = exc.__context__
cause = exc.__cause__
- if cause is not None and cause not in seen:
+ if cause is not None and id(cause) not in seen:
print_exc(type(cause), cause, cause.__traceback__)
print("\nThe above exception was the direct cause "
"of the following exception:\n", file=efile)
elif (context is not None and
not exc.__suppress_context__ and
- context not in seen):
+ id(context) not in seen):
print_exc(type(context), context, context.__traceback__)
print("\nDuring handling of the above exception, "
"another exception occurred:\n", file=efile)