Skip to content

[3.5] bpo-29692: contextlib.contextmanager may incorrectly unchain Ru…#1107

Merged
Mariatta merged 1 commit intopython:3.5from
Mariatta:backport-00c75e9-3.5
Apr 13, 2017
Merged

[3.5] bpo-29692: contextlib.contextmanager may incorrectly unchain Ru…#1107
Mariatta merged 1 commit intopython:3.5from
Mariatta:backport-00c75e9-3.5

Conversation

@Mariatta
Copy link
Member

…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)

…ntimeError (pythonGH-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)
@Mariatta Mariatta merged commit 4d015a4 into python:3.5 Apr 13, 2017
@Mariatta Mariatta deleted the backport-00c75e9-3.5 branch April 13, 2017 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants