Make @asynchronous's added 'handler' argument be keyword instead of positional

Adding a positional argument caused a problem when
@authenticated_api_view started using @has_request_variables
internally.  The 'handler' argument used to be passed through
positionally to the wrapped function, but when using
@has_request_variables, the wrapper inside @authenticated_api_view
had to take additional arguments.  The handler argument was then
assigned to one of those parameters instead of being passed through.

(imported from commit 66240bd465c803ddcbf4a603509051fca7381468)
This commit is contained in:
Zev Benjamin 2012-11-15 12:52:46 -05:00
parent 6f345e393e
commit 3bc47bc44a
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ def asynchronous(method):
@wraps(method)
def wrapper(request, *args, **kwargs):
try:
v = method(request, request._tornado_handler, *args, **kwargs)
v = method(request, handler=request._tornado_handler, *args, **kwargs)
if v == None or type(v) == types.GeneratorType:
raise TornadoAsyncException
except _DefGen_Return, e: