Patch #1638243: the compiler package is now able to correctly compile

a with statement; previously, executing code containing a with statement
compiled by the compiler package crashed the interpreter.
This commit is contained in:
Georg Brandl 2007-01-27 17:43:02 +00:00
parent 7a7cbae77b
commit ab49684f55
4 changed files with 38 additions and 1 deletions

View file

@ -960,7 +960,7 @@ class Transformer:
if nodelist[2][0] == token.COLON:
var = None
else:
var = self.com_node(nodelist[2])
var = self.com_assign(nodelist[2][2], OP_ASSIGN)
return With(expr, var, body, lineno=nodelist[0][2])
def com_with_var(self, nodelist):