[Python-checkins] cpython (merge 3.3 -> default): merge 3.3 (#17669)

benjamin.peterson python-checkins at python.org
Wed Apr 10 23:01:48 CEST 2013


http://hg.python.org/cpython/rev/0b2d4089180c
changeset:   83239:0b2d4089180c
parent:      83237:308b216f084f
parent:      83238:35cb75b9d653
user:        Benjamin Peterson <benjamin at python.org>
date:        Wed Apr 10 17:01:38 2013 -0400
summary:
  merge 3.3 (#17669)

files:
  Misc/NEWS           |  2 ++
  Objects/genobject.c |  2 +-
  2 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,8 @@
 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
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -178,7 +178,7 @@
     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);
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list