From ab7bf2143e67ddc1510413fa0d7f9c621adf22fa Mon Sep 17 00:00:00 2001 From: Nick Coghlan Date: Sun, 26 Feb 2012 17:49:52 +1000 Subject: Close issue #6210: Implement PEP 409 --- Lib/traceback.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Lib/traceback.py') 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: -- cgit v1.2.1