Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(868)

Unified Diff: Lib/traceback.py

Issue 6210: Exception Chaining missing method for suppressing context
Patch Set: Created 1 year, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_traceback.py ('k') | Misc/ACKS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/traceback.py Wed Feb 15 23:45:34 2012 +0100
+++ b/Lib/traceback.py Wed Feb 15 22:51:26 2012 -0800
@@ -120,14 +120,14 @@
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:
« no previous file with comments | « Lib/test/test_traceback.py ('k') | Misc/ACKS » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7