summaryrefslogtreecommitdiff
path: root/Lib/traceback.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2012-02-26 17:49:52 +1000
committerNick Coghlan <ncoghlan@gmail.com>2012-02-26 17:49:52 +1000
commitab7bf2143e67ddc1510413fa0d7f9c621adf22fa (patch)
tree62a24ed4f57e4db638ebde745bb83e2e09fc86e3 /Lib/traceback.py
parentcda6b6d60d96e6f755da92deb5e4066839095791 (diff)
downloadcpython-git-ab7bf2143e67ddc1510413fa0d7f9c621adf22fa.tar.gz
Close issue #6210: Implement PEP 409
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r--Lib/traceback.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py
index 8d4e96edcb..35858af1cc 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -120,14 +120,14 @@ def _iter_chain(exc, custom_tb=None, seen=None):
seen.add(exc)
its = []
cause = exc.__cause__
- if cause is not None and cause not in seen:
- its.append(_iter_chain(cause, None, seen))
- its.append([(_cause_message, None)])
- else:
+ if cause is Ellipsis:
context = exc.__context__
if context is not None and context not in seen:
its.append(_iter_chain(context, None, seen))
its.append([(_context_message, None)])
+ elif cause is not None and cause not in seen:
+ its.append(_iter_chain(cause, False, seen))
+ its.append([(_cause_message, None)])
its.append([(exc, custom_tb or exc.__traceback__)])
# itertools.chain is in an extension module and may be unavailable
for it in its: