mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
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:
parent
7a7cbae77b
commit
ab49684f55
4 changed files with 38 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue