From fd7286646909501376c9a205bed28cdf610bcbe3 Mon Sep 17 00:00:00 2001 From: "Serge S. Koval" Date: Sat, 13 Apr 2013 23:12:37 +0300 Subject: [PATCH] Comparison fix --- tornado/stack_context.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tornado/stack_context.py b/tornado/stack_context.py index 7c2dea98e..7b4839a1b 100644 --- a/tornado/stack_context.py +++ b/tornado/stack_context.py @@ -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)') -- 2.47.2