summaryrefslogtreecommitdiffstats
path: root/Lib/compiler/pycodegen.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-01-27 17:43:02 (GMT)
committerGeorg Brandl <georg@python.org>2007-01-27 17:43:02 (GMT)
commitab49684f550ce6b12614b8a329f4d280e20e1277 (patch)
treef813125ca6d4bbda770e4e3566e470069f917f09 /Lib/compiler/pycodegen.py
parent7a7cbae77b417b855bdfe5f7c536893cbefcbb1d (diff)
downloadcpython-ab49684f550ce6b12614b8a329f4d280e20e1277.zip
cpython-ab49684f550ce6b12614b8a329f4d280e20e1277.tar.gz
cpython-ab49684f550ce6b12614b8a329f4d280e20e1277.tar.bz2
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.
Diffstat (limited to 'Lib/compiler/pycodegen.py')
-rw-r--r--Lib/compiler/pycodegen.py2
1 files changed, 2 insertions, 0 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()