diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2012-02-26 07:49:52 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2012-02-26 07:49:52 (GMT) |
commit | ab7bf2143e67ddc1510413fa0d7f9c621adf22fa (patch) | |
tree | 62a24ed4f57e4db638ebde745bb83e2e09fc86e3 /Lib/traceback.py | |
parent | cda6b6d60d96e6f755da92deb5e4066839095791 (diff) | |
download | cpython-ab7bf2143e67ddc1510413fa0d7f9c621adf22fa.zip cpython-ab7bf2143e67ddc1510413fa0d7f9c621adf22fa.tar.gz cpython-ab7bf2143e67ddc1510413fa0d7f9c621adf22fa.tar.bz2 |
Close issue #6210: Implement PEP 409
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index 8d4e96e..35858af 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: |