Permalink
Browse files

Comparison fix

  • Loading branch information...
mrjoes committed Apr 13, 2013
1 parent 681e76a commit fd7286646909501376c9a205bed28cdf610bcbe3
Showing with 2 additions and 2 deletions.
  1. +2 −2 tornado/stack_context.py
View
@@ -146,7 +146,7 @@ def __exit__(self, type, value, traceback):
# Note that this check comes after restoring _state.context
# so that if it fails things are left in a (relatively)
# consistent state.
- if final_contexts != self.new_contexts:
+ if final_contexts is not self.new_contexts:
raise StackContextInconsistentError(
'stack_context inconsistency (may be caused by yield '
'within a "with StackContext" block)')
@@ -185,7 +185,7 @@ def __exit__(self, type, value, traceback):
final_contexts = _state.contexts
_state.contexts = self.old_contexts
- if final_contexts != self.new_contexts:
+ if final_contexts is not self.new_contexts:
raise StackContextInconsistentError(
'stack_context inconsistency (may be caused by yield '
'within a "with StackContext" block)')

0 comments on commit fd72866

Please sign in to comment.