Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion bottle.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,14 +582,19 @@ def get_undecorated_callback(self):
closure_attr = '__closure__' if py3k else 'func_closure'
while hasattr(func, closure_attr) and getattr(func, closure_attr):
attributes = getattr(func, closure_attr)
prev_func = func
func = attributes[0].cell_contents

# in case of decorators with multiple arguments
if not isinstance(func, FunctionType):
# pick first FunctionType instance from multiple arguments
func = filter(lambda x: isinstance(x, FunctionType),
map(lambda x: x.cell_contents, attributes))
func = list(func)[0] # py3 support
func_list = list(func)
if len(func_list)==0:
func = prev_func
break
func = func_list[0] # py3 support
return func

def get_callback_args(self):
Expand Down