[Zope-Checkins] CVS: Zope2 - symbols.py:1.3
evan@serenade.digicool.com
evan@serenade.digicool.com
Mon, 14 May 2001 17:48:06 -0400
Update of /cvs-repository/Zope2/lib/python/RestrictedPython/compiler
In directory serenade:/home/evan/Zope/trunk/lib/python/RestrictedPython/compiler
Modified Files:
symbols.py
Log Message:
Prevent the subject of attribute and subscript assignment from being marked as a local variable.
--- Updated File symbols.py in package Zope2 --
--- symbols.py 2001/04/27 20:27:54 1.2
+++ symbols.py 2001/05/14 21:48:06 1.3
@@ -298,6 +298,14 @@
def visitAssName(self, node, scope, assign=1):
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):
# If the LHS is a name, then this counts as assignment.
# Otherwise, it's just use.