[3.5] bpo-29692: contextlib.contextmanager may incorrectly unchain Ru… by Mariatta · Pull Request #1107 · python/cpython (original) (raw)
…ntimeError (GH-949)
contextlib._GeneratorContextManager.exit includes a special case to deal with
PEP 479 RuntimeErrors created when StopIteration
is thrown into the context
manager body.
Previously this check was too permissive, and undid one level of chaining on all
RuntimeError instances, not just those that wrapped a StopIteration instance.
(cherry picked from commit 00c75e9)