]> git.ipfire.org Git - thirdparty/tornado.git/commit
Detect stack context inconsistency in gen.Runner.
authorBen Darnell <ben@bendarnell.com>
Mon, 27 Jan 2014 00:11:51 +0000 (19:11 -0500)
committerBen Darnell <ben@bendarnell.com>
Mon, 27 Jan 2014 00:45:50 +0000 (19:45 -0500)
commit71158fe8ba27dc4f5c014294b69804b3c9e65be5
treea3d81dce7971a8259236e8243fc002b115297426
parent0ea4de346d8ce0272f7cf2f67c3fadb8b9f5f7a3
Detect stack context inconsistency in gen.Runner.

The existing checks in StackContext.__exit__ are run after the damage has
been done and may raise exceptions in the wrong place; gen.Runner
is a more reliable place to detect this problem.

Throwing the exception into the generator provides a better stack trace
for the problem and also simplifies some of the complexity of testing for
this feature.
tornado/gen.py
tornado/test/stack_context_test.py