We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 049dbb9 commit 3b632eeCopy full SHA for 3b632ee
unpythonic/syntax/scopeanalyzer.py
@@ -109,7 +109,8 @@ def transform(self, tree):
109
self.generic_withstate(tree, args=(args + moreargs))
110
elif type(tree) in (FunctionDef, AsyncFunctionDef):
111
# Decorator list is processed in the surrounding scope
112
- tree.decorator_list = self.visit(tree.decorator_list)
+ new_decorator_list = self.visit(tree.decorator_list)
113
+ tree.decorator_list = new_decorator_list if new_decorator_list is not None else []
114
115
moreargs, newnonlocals = get_lexical_variables(tree, collect_locals=False)
116
0 commit comments