]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Comparison fix
authorSerge S. Koval <serge.koval+github@gmail.com>
Sat, 13 Apr 2013 20:12:37 +0000 (23:12 +0300)
committerSerge S. Koval <serge.koval+github@gmail.com>
Sat, 13 Apr 2013 20:12:37 +0000 (23:12 +0300)
tornado/stack_context.py

index 7c2dea98e8398c482f01ba00379b2fba311ab8ee..7b4839a1b93d25e80ada799d55f023e08585c8bf 100644 (file)
@@ -146,7 +146,7 @@ class StackContext(object):
             # 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 @@ class ExceptionStackContext(object):
             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)')