From: Andrej A Antonov Date: Wed, 27 Jun 2012 01:18:54 +0000 (+0400) Subject: fixed the bug that tornado.stack_context.wrap restricts kwargs for function X-Git-Tag: v2.4.0~50^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aff6834412c63a0a0af9920e77d615d9e0bd9b85;p=thirdparty%2Ftornado.git fixed the bug that tornado.stack_context.wrap restricts kwargs for function --- 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