diff --git a/Misc/NEWS b/Misc/NEWS index 0d13c705e5a..3543f325691 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,8 @@ What's New in Python 3.4.0 Alpha 1? Core and Builtins ----------------- +- Issue #17669: Fix crash involving finalization of generators using yield from. + - Issue #14439: Python now prints the traceback on runpy failure at startup. - Issue #17469: Fix _Py_GetAllocatedBlocks() and sys.getallocatedblocks() diff --git a/Objects/genobject.c b/Objects/genobject.c index 597aed37a11..016bfa29752 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -178,7 +178,7 @@ gen_yf(PyGenObject *gen) PyObject *yf = NULL; PyFrameObject *f = gen->gi_frame; - if (f) { + if (f && f->f_stacktop) { PyObject *bytecode = f->f_code->co_code; unsigned char *code = (unsigned char *)PyBytes_AS_STRING(bytecode);