aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2014-01-24 23:05:45 +1000
committerNick Coghlan <ncoghlan@gmail.com>2014-01-24 23:05:45 +1000
commitadd94c9d825dc2d870f6557e1d6510a82d3dba12 (patch)
treee8f1fa62040ee9397326569dbd6aea32769b598c /Lib/contextlib.py
parentuse new readline function types (closes #20374) (diff)
downloadcpython-add94c9d825dc2d870f6557e1d6510a82d3dba12.tar.gz
cpython-add94c9d825dc2d870f6557e1d6510a82d3dba12.tar.bz2
cpython-add94c9d825dc2d870f6557e1d6510a82d3dba12.zip
Issue 20317: Remove debugging code from contextlib
- Alex J Burke noticed a debugging raise in the commit that fixed the original bug reported in issue 20317 - this showed that multiple iterations through the affected loop wasn't actually being tested
Diffstat (limited to 'Lib/contextlib.py')
-rw-r--r--Lib/contextlib.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/contextlib.py b/Lib/contextlib.py
index f87828569a1..b03f8283194 100644
--- a/Lib/contextlib.py
+++ b/Lib/contextlib.py
@@ -231,7 +231,7 @@ class ExitStack(object):
# we were actually nesting multiple with statements
frame_exc = sys.exc_info()[1]
def _fix_exception_context(new_exc, old_exc):
- # Context isn't what we want, so find the end of the chain
+ # Context may not be correct, so find the end of the chain
while 1:
exc_context = new_exc.__context__
if exc_context is old_exc:
@@ -239,8 +239,6 @@ class ExitStack(object):
return
if exc_context is None or exc_context is frame_exc:
break
- details = id(new_exc), id(old_exc), id(exc_context)
- raise Exception(str(details))
new_exc = exc_context
# Change the end of the chain to point to the exception
# we expect it to reference