Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore handled exception when popping the context #1393

Merged

Conversation

@mjpieters
Copy link
Contributor

commented Mar 23, 2015

This is a fix for #1392; the app and request contexts should not report an exception when tearing down after an exception has already been handled in a with statement.

mjpieters added some commits Mar 23, 2015

Switch away from using None as default value for the exception when t…
…earing down a context.

When an exception has been handled when using the request / app context in a with statement, `sys.exc_info()` will still contain the exception information even though it has been handled already. The `__exit__` methods pass in `None` for the exception value in that case, which needs to be distinguisable from the default value for the `exc` parameter. Use a dedicated singleton sentinel value instead.

@untitaker untitaker merged commit ecaaa50 into pallets:master Mar 23, 2015

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

untitaker added a commit that referenced this pull request Mar 23, 2015

@untitaker

This comment has been minimized.

Copy link
Member

commented Mar 23, 2015

Excellent, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.