STINNER Victor added the comment: Workaround, or maybe fix?, for the issue:
diff -r 0af15b8ef3b2 Lib/contextlib.py --- a/Lib/contextlib.py Thu May 12 10:37:58 2016 +0300 +++ b/Lib/contextlib.py Wed May 25 15:56:50 2016 +0200 @@ -87,6 +87,8 @@ class _GeneratorContextManager(ContextDe # (see PEP 479). if exc.__cause__ is value: return False + if exc is value: + return raise except: # only re-raise if it's *not* the exception that was ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27122> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com