Skip to content

Commit c688d2b

Browse files
authored
Fix pyflakes for removal of ast.Param (#523)
* Fix pyflakes for removal of ast.Param * Remove AugStore / AugLoad (not even used in py2)
1 parent 684f14d commit c688d2b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pyflakes/checker.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ def handleNodeStore(self, node):
12281228
binding = Binding(name, node)
12291229
elif name == '__all__' and isinstance(self.scope, ModuleScope):
12301230
binding = ExportBinding(name, node._pyflakes_parent, self.scope)
1231-
elif isinstance(getattr(node, 'ctx', None), ast.Param):
1231+
elif PY2 and isinstance(getattr(node, 'ctx', None), ast.Param):
12321232
binding = Argument(name, self.getScopeNode(node))
12331233
else:
12341234
binding = Assignment(name, node)
@@ -1888,13 +1888,15 @@ def NAME(self, node):
18881888
Handle occurrence of Name (which can be a load/store/delete access.)
18891889
"""
18901890
# Locate the name in locals / function / globals scopes.
1891-
if isinstance(node.ctx, (ast.Load, ast.AugLoad)):
1891+
if isinstance(node.ctx, ast.Load):
18921892
self.handleNodeLoad(node)
18931893
if (node.id == 'locals' and isinstance(self.scope, FunctionScope) and
18941894
isinstance(node._pyflakes_parent, ast.Call)):
18951895
# we are doing locals() call in current scope
18961896
self.scope.usesLocals = True
1897-
elif isinstance(node.ctx, (ast.Store, ast.AugStore, ast.Param)):
1897+
elif isinstance(node.ctx, ast.Store):
1898+
self.handleNodeStore(node)
1899+
elif PY2 and isinstance(node.ctx, ast.Param):
18981900
self.handleNodeStore(node)
18991901
elif isinstance(node.ctx, ast.Del):
19001902
self.handleNodeDelete(node)

0 commit comments

Comments
 (0)