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

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.

…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
untitaker added a commit that referenced this pull request Mar 23, 2015
@untitaker
Copy link
Contributor

Excellent, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants