From: Neil Schemenauer Date: Sat, 7 Feb 2009 00:13:39 +0000 (+0000) Subject: Make names generated for 'with' variables match the built-in compiler. X-Git-Tag: v2.7a1~2090 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98c3b85bc4b64307fc12b53210f941c6458bccb5;p=python Make names generated for 'with' variables match the built-in compiler. --- diff --git a/Lib/compiler/pycodegen.py b/Lib/compiler/pycodegen.py index 808f51f417..e7ce1a9ddb 100644 --- a/Lib/compiler/pycodegen.py +++ b/Lib/compiler/pycodegen.py @@ -814,8 +814,8 @@ class CodeGenerator: def visitWith(self, node): body = self.newBlock() final = self.newBlock() - valuevar = "$value%d" % self.__with_count self.__with_count += 1 + valuevar = "_[%d]" % self.__with_count self.set_lineno(node) self.visit(node.expr) self.emit('DUP_TOP')