From aff6834412c63a0a0af9920e77d615d9e0bd9b85 Mon Sep 17 00:00:00 2001 From: Andrej A Antonov Date: Wed, 27 Jun 2012 05:18:54 +0400 Subject: [PATCH] fixed the bug that tornado.stack_context.wrap restricts kwargs for function --- tornado/stack_context.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tornado/stack_context.py b/tornado/stack_context.py index 184376295..afce681ba 100644 --- a/tornado/stack_context.py +++ b/tornado/stack_context.py @@ -195,7 +195,9 @@ def wrap(fn): # functools.wraps doesn't appear to work on functools.partial objects #@functools.wraps(fn) - def wrapped(callback, contexts, *args, **kwargs): + def wrapped(*args, **kwargs): + callback, contexts, args = args[0], args[1], args[2:] + if contexts is _state.contexts or not contexts: callback(*args, **kwargs) return -- 2.47.2