diff options
author | Anthony Sottile <asottile@umich.edu> | 2020-03-18 08:19:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-18 08:19:23 -0700 |
commit | c688d2b02ac6e3416775b88d6411ee6a3e8a51ec (patch) | |
tree | e177f48d54c9162877b58623669fd57d947a3827 | |
parent | 684f14db591e9f23a6f27c04300497f56413da8d (diff) | |
download | pyflakes-c688d2b02ac6e3416775b88d6411ee6a3e8a51ec.tar.gz |
Fix pyflakes for removal of ast.Param (#523)
* Fix pyflakes for removal of ast.Param
* Remove AugStore / AugLoad (not even used in py2)
-rw-r--r-- | pyflakes/checker.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pyflakes/checker.py b/pyflakes/checker.py index 2b6a98f..5af956c 100644 --- a/pyflakes/checker.py +++ b/pyflakes/checker.py @@ -1228,7 +1228,7 @@ class Checker(object): binding = Binding(name, node) elif name == '__all__' and isinstance(self.scope, ModuleScope): binding = ExportBinding(name, node._pyflakes_parent, self.scope) - elif isinstance(getattr(node, 'ctx', None), ast.Param): + elif PY2 and isinstance(getattr(node, 'ctx', None), ast.Param): binding = Argument(name, self.getScopeNode(node)) else: binding = Assignment(name, node) @@ -1888,13 +1888,15 @@ class Checker(object): Handle occurrence of Name (which can be a load/store/delete access.) """ # Locate the name in locals / function / globals scopes. - if isinstance(node.ctx, (ast.Load, ast.AugLoad)): + if isinstance(node.ctx, ast.Load): self.handleNodeLoad(node) if (node.id == 'locals' and isinstance(self.scope, FunctionScope) and isinstance(node._pyflakes_parent, ast.Call)): # we are doing locals() call in current scope self.scope.usesLocals = True - elif isinstance(node.ctx, (ast.Store, ast.AugStore, ast.Param)): + elif isinstance(node.ctx, ast.Store): + self.handleNodeStore(node) + elif PY2 and isinstance(node.ctx, ast.Param): self.handleNodeStore(node) elif isinstance(node.ctx, ast.Del): self.handleNodeDelete(node) |