Merged revisions 78766 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r78766 | benjamin.peterson | 2010-03-07 11:10:51 -0600 (Sun, 07 Mar 2010) | 1 line

  prevent generator finalization from invalidating sys.exc_info() #7173
........
This commit is contained in:
Benjamin Peterson 2010-03-07 17:14:15 +00:00
parent 056c060589
commit d01444d325
3 changed files with 19 additions and 2 deletions

View file

@ -1107,7 +1107,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