]> git.ipfire.org Git - thirdparty/tornado.git/commit
Simplify StackContext logic and behavior.
authorBen Darnell <ben@bendarnell.com>
Sat, 29 Sep 2012 21:29:22 +0000 (14:29 -0700)
committerBen Darnell <ben@bendarnell.com>
Sat, 29 Sep 2012 21:41:30 +0000 (14:41 -0700)
commit2ded26610f9f3f7962129617bc2b60d1856708da
treed17710fe7d4bbd58fc0396e9ef48c7283004736a
parent69e449201c5235b3502107b15df213d62255cc30
Simplify StackContext logic and behavior.

Previously, there was an optimization to avoid recreating contexts
that were already on the stack.  This optimization rarely mattered
(especially given the movement to run all callbacks through
IOLoop.add_callback), and sometimes caused surprising behavior as
other exception handlers could be inserted between stack contexts that
expected to be adjacent to each other or to the wrapped function.  Now
each wrapped function recreates its full stack of contexts, even if
some of those contexts were already on the stack.

This change allows a use of NullContext in testing.py to be
removed.
tornado/stack_context.py
tornado/testing.py