Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't use range for performance reasons

  • Loading branch information...
commit 78d9cc6519f2894783b3409ca67360173e8a26fa 1 parent f716564
Serge S. Koval mrjoes authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 tornado/stack_context.py
5 tornado/stack_context.py
View
@@ -259,8 +259,9 @@ def wrapped(*args, **kwargs):
exc = _handle_exception(top, exc)
else:
# Otherwise take shorter path and run stack contexts in reverse order
- for n in range(last_ctx - 1, -1, -1):
- c = stack[n]
+ while last_ctx > 0:
+ last_ctx -= 1
+ c = stack[last_ctx]
try:
c.exit(*exc)
Please sign in to comment.
Something went wrong with that request. Please try again.