commit | e53fcfd7d32343bd1a5780a85ed9bfde0c8f79b6 | [log] [tgz] |
---|---|---|
author | Nick Coghlan <ncoghlan@gmail.com> | Wed Nov 07 12:26:40 2007 +0000 |
committer | Nick Coghlan <ncoghlan@gmail.com> | Wed Nov 07 12:26:40 2007 +0000 |
tree | 7c2f3fc31aad51e8a1450d79774229853bd5bdba | |
parent | 2e49f781cb299bb1c832b663dc50d7d4fad67321 [diff] [blame] |
Fix issue #1705170 (backport from trunk)
diff --git a/Lib/contextlib.py b/Lib/contextlib.py index a807c42..c4fab1b 100644 --- a/Lib/contextlib.py +++ b/Lib/contextlib.py
@@ -25,6 +25,10 @@ else: raise RuntimeError("generator didn't stop") else: + if value is None: + # Need to force instantiation so we can reliably + # tell if we get the same exception back + value = type() try: self.gen.throw(type, value, traceback) raise RuntimeError("generator didn't stop after throw()")