summaryrefslogtreecommitdiffstats
path: root/Lib/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/compiler')
-rw-r--r--Lib/compiler/pycodegen.py2
-rw-r--r--Lib/compiler/transformer.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/Lib/compiler/pycodegen.py b/Lib/compiler/pycodegen.py
index 8cf7d77..b46b1c1 100644
--- a/Lib/compiler/pycodegen.py
+++ b/Lib/compiler/pycodegen.py
@@ -849,6 +849,8 @@ class CodeGenerator:
self.emit('LOAD_CONST', None)
self.nextBlock(final)
self.setups.push((END_FINALLY, final))
+ self._implicitNameOp('LOAD', exitvar)
+ self._implicitNameOp('DELETE', exitvar)
self.emit('WITH_CLEANUP')
self.emit('END_FINALLY')
self.setups.pop()
diff --git a/Lib/compiler/transformer.py b/Lib/compiler/transformer.py
index a16dc55..ac23ad1 100644
--- a/Lib/compiler/transformer.py
+++ b/Lib/compiler/transformer.py
@@ -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):