Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(131)

Unified Diff: Python/ceval.c

Issue 842: Exception state lives too long in 3.0 (Closed) SVN Base: http://svn.python.org/view/*checkout*/python/branches/py3k/
Patch Set: Created 4 months, 1 week ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side by-side-diff with in-line comments
Download patch
Index: Python/ceval.c
===================================================================
--- Python/ceval.c (revision 62647)
+++ Python/ceval.c (working copy)
@@ -1477,6 +1477,19 @@
"'finally' pops bad exception");
why = WHY_EXCEPTION;
}
+ /*
+ Make sure the exception state is cleaned up before
+ the end of an except block. This ensures objects
+ referenced by the exception state are not kept
+ alive too long.
+ See #2507.
jhylton 2008/05/06 12:59:48 We don't have a lot of comments that refer to spec
Antoine Pitrou 2008/05/06 15:19:41 On 2008/05/06 12:59:48, jhylton wrote: > We don't
+ */
Antoine Pitrou 2008/05/02 22:17:07 Hmm, it looks like I have gone past the 79-column
+ if (tstate->frame->f_exc_type != NULL)
+ reset_exc_info(tstate);
+ else {
+ assert(tstate->frame->f_exc_value == NULL);
+ assert(tstate->frame->f_exc_traceback == NULL);
jhylton 2008/05/06 12:59:48 I'd move the asserts outside of the else. They sh
Antoine Pitrou 2008/05/06 15:19:41 On 2008/05/06 12:59:48, jhylton wrote: > I'd move
+ }
Py_DECREF(v);
break;
« Lib/test/test_exceptions.py ('k') | no next file »

Powered by Google App Engine
This is Rietveld r305