summaryrefslogtreecommitdiffstats
path: root/Lib/compiler/pycodegen.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-01-27 17:43:07 (GMT)
committerGeorg Brandl <georg@python.org>2007-01-27 17:43:07 (GMT)
commit20aa477a2d07ed85b81c4ecda74b51444f9c6b38 (patch)
tree0d7d05ab4e60a22674b9cd602c8447f8c65379d2 /Lib/compiler/pycodegen.py
parentb17830e70902a5c056b1219c1429f92c91b9010a (diff)
downloadcpython-20aa477a2d07ed85b81c4ecda74b51444f9c6b38.zip
cpython-20aa477a2d07ed85b81c4ecda74b51444f9c6b38.tar.gz
cpython-20aa477a2d07ed85b81c4ecda74b51444f9c6b38.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. (backport from rev. 53575)
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 009438d..2af03a8 100644
--- a/Lib/compiler/pycodegen.py
+++ b/Lib/compiler/pycodegen.py
@@ -851,6 +851,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()