summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-03-10 02:28:35 (GMT)
committerGuido van Rossum <guido@python.org>2006-03-10 02:28:35 (GMT)
commitf669436189dd44a841caa9ab1ad97a3f7662bf58 (patch)
tree1a717975d09d4867e8807710a36a6c2999afdb7e /Python/compile.c
parent692cdbc5d648da5239b5caececc954960aa024e9 (diff)
downloadcpython-f669436189dd44a841caa9ab1ad97a3f7662bf58.zip
cpython-f669436189dd44a841caa9ab1ad97a3f7662bf58.tar.gz
cpython-f669436189dd44a841caa9ab1ad97a3f7662bf58.tar.bz2
Um, I thought I'd already checked this in.
Anyway, this is the changes to the with-statement so that __exit__ must return a true value in order for a pending exception to be ignored. The PEP (343) is already updated.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Python/compile.c b/Python/compile.c
index c07b6d3..e3b3df8 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1382,7 +1382,7 @@ opcode_stack_effect(int opcode, int oparg)
case BREAK_LOOP:
return 0;
case WITH_CLEANUP:
- return 3;
+ return -1; /* XXX Sometimes more */
case LOAD_LOCALS:
return 1;
case RETURN_VALUE:
@@ -3472,8 +3472,6 @@ compiler_with(struct compiler *c, stmt_ty s)
!compiler_nameop(c, tmpexit, Del))
return 0;
ADDOP(c, WITH_CLEANUP);
- ADDOP_I(c, CALL_FUNCTION, 3);
- ADDOP(c, POP_TOP);
/* Finally block ends. */
ADDOP(c, END_FINALLY);