[Python-checkins] r43610 - python/trunk/Lib/contextlib.py

phillip.eby python-checkins at python.org
Mon Apr 3 23:20:08 CEST 2006


Author: phillip.eby
Date: Mon Apr  3 23:20:07 2006
New Revision: 43610

Modified:
   python/trunk/Lib/contextlib.py
Log:
Fix typos; enhance comments on patch for SF #1462485.
 --This line, and those below, will be ignored--

M    contextlib.py


Modified: python/trunk/Lib/contextlib.py
==============================================================================
--- python/trunk/Lib/contextlib.py	(original)
+++ python/trunk/Lib/contextlib.py	Mon Apr  3 23:20:07 2006
@@ -32,8 +32,9 @@
                 self.gen.throw(type, value, traceback)
                 raise RuntimeError("generator didn't stop after throw()")
             except StopIteration:
-                # Supress the exception unless it's the same exception the
-                # was passed to throw().
+                # Suppress the exception *unless* it's the same exception that
+                # was passed to throw().  This prevents a StopIteration
+                # raised inside the "with" statement from being suppressed
                 return sys.exc_info()[1] is not value
             except:
                 # only re-raise if it's *not* the exception that was


More information about the Python-checkins mailing list