diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-03-07 17:10:51 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-03-07 17:10:51 (GMT) |
commit | ae5f2f4a39e6a3f4c45e9dc95bd4e1fe5dfb60f2 (patch) | |
tree | df848682fc6653aeeb109df7fd4547e5efa2817a /Python | |
parent | 0e4c22c922c67297e5664ff9685b143fff1fddf5 (diff) | |
download | cpython-ae5f2f4a39e6a3f4c45e9dc95bd4e1fe5dfb60f2.zip cpython-ae5f2f4a39e6a3f4c45e9dc95bd4e1fe5dfb60f2.tar.gz cpython-ae5f2f4a39e6a3f4c45e9dc95bd4e1fe5dfb60f2.tar.bz2 |
prevent generator finalization from invalidating sys.exc_info() #7173
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 5d1fb28..47c53cf 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1159,7 +1159,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) assert(stack_pointer != NULL); f->f_stacktop = NULL; /* remains NULL unless yield suspends frame */ - if (f->f_code->co_flags & CO_GENERATOR) { + if (co->co_flags & CO_GENERATOR && !throwflag) { if (f->f_exc_type != NULL && f->f_exc_type != Py_None) { /* We were in an except handler when we left, restore the exception state which was put aside |