Commit 596e68c4 authored by Evan Simpson's avatar Evan Simpson

Prevent the subject of attribute and subscript assignment from being marked as a local variable.

parent b273c0cf
...@@ -298,6 +298,14 @@ class SymbolVisitor: ...@@ -298,6 +298,14 @@ class SymbolVisitor:
def visitAssName(self, node, scope, assign=1): def visitAssName(self, node, scope, assign=1):
scope.add_def(node.name) scope.add_def(node.name)
def visitAssAttr(self, node, scope, assign=0):
self.visit(node.expr, scope, 0)
def visitSubscript(self, node, scope, assign=0):
self.visit(node.expr, scope, 0)
for n in node.subs:
self.visit(n, scope, 0)
def visitAugAssign(self, node, scope): def visitAugAssign(self, node, scope):
# If the LHS is a name, then this counts as assignment. # If the LHS is a name, then this counts as assignment.
# Otherwise, it's just use. # Otherwise, it's just use.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment