Skip to content

Commit 3b632ee

Browse files
committed
porting bugfix: decorator list handling in scopeanalyzer
1 parent 049dbb9 commit 3b632ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

unpythonic/syntax/scopeanalyzer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ def transform(self, tree):
109109
self.generic_withstate(tree, args=(args + moreargs))
110110
elif type(tree) in (FunctionDef, AsyncFunctionDef):
111111
# Decorator list is processed in the surrounding scope
112-
tree.decorator_list = self.visit(tree.decorator_list)
112+
new_decorator_list = self.visit(tree.decorator_list)
113+
tree.decorator_list = new_decorator_list if new_decorator_list is not None else []
113114

114115
moreargs, newnonlocals = get_lexical_variables(tree, collect_locals=False)
115116

0 commit comments

Comments
 (0)