Skip to content

Commit fd72866

Browse files
committed
Comparison fix
1 parent 681e76a commit fd72866

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tornado/stack_context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def __exit__(self, type, value, traceback):
146146
# Note that this check comes after restoring _state.context
147147
# so that if it fails things are left in a (relatively)
148148
# consistent state.
149-
if final_contexts != self.new_contexts:
149+
if final_contexts is not self.new_contexts:
150150
raise StackContextInconsistentError(
151151
'stack_context inconsistency (may be caused by yield '
152152
'within a "with StackContext" block)')
@@ -185,7 +185,7 @@ def __exit__(self, type, value, traceback):
185185
final_contexts = _state.contexts
186186
_state.contexts = self.old_contexts
187187

188-
if final_contexts != self.new_contexts:
188+
if final_contexts is not self.new_contexts:
189189
raise StackContextInconsistentError(
190190
'stack_context inconsistency (may be caused by yield '
191191
'within a "with StackContext" block)')

0 commit comments

Comments
 (0)