diff options
Diffstat (limited to 'Lib/contextlib.py')
-rw-r--r-- | Lib/contextlib.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/contextlib.py b/Lib/contextlib.py index aa5335d9c4..157b4ccb8d 100644 --- a/Lib/contextlib.py +++ b/Lib/contextlib.py @@ -127,7 +127,10 @@ def nested(*contexts): except: exc = sys.exc_info() if exc != (None, None, None): - raise + # Don't rely on sys.exc_info() still containing + # the right information. Another exception may + # have been raised and caught by an exit method + raise exc[0], exc[1], exc[2] @contextmanager |