Fix SF#1462485: StopIteration raised in body of 'with' statement suppressed
diff --git a/Lib/contextlib.py b/Lib/contextlib.py
index 9c00ef0..c26e27e 100644
--- a/Lib/contextlib.py
+++ b/Lib/contextlib.py
@@ -32,7 +32,9 @@
                 self.gen.throw(type, value, traceback)
                 raise RuntimeError("generator didn't stop after throw()")
             except StopIteration:
-                return True
+                # Supress the exception unless it's the same exception the
+                # was passed to throw().
+                return sys.exc_info()[1] is not value
             except:
                 # only re-raise if it's *not* the exception that was
                 # passed to throw(), because __exit__() must not raise