Make names generated for 'with' variables match the built-in compiler.

This commit is contained in:
Neil Schemenauer 2009-02-07 00:13:39 +00:00
parent 8be8765a2e
commit 98c3b85bc4
1 changed files with 1 additions and 1 deletions

View File

@ -814,8 +814,8 @@ class CodeGenerator:
def visitWith(self, node): def visitWith(self, node):
body = self.newBlock() body = self.newBlock()
final = self.newBlock() final = self.newBlock()
valuevar = "$value%d" % self.__with_count
self.__with_count += 1 self.__with_count += 1
valuevar = "_[%d]" % self.__with_count
self.set_lineno(node) self.set_lineno(node)
self.visit(node.expr) self.visit(node.expr)
self.emit('DUP_TOP') self.emit('DUP_TOP')