summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorPhillip J. Eby <pje@telecommunity.com>2006-04-10 17:51:05 (GMT)
committerPhillip J. Eby <pje@telecommunity.com>2006-04-10 17:51:05 (GMT)
commit2ba96610bfeda03381dd411d5694fae311159a0c (patch)
treea0007d4f0c9ee9bb38dbdef8311e7e0085708097 /Python
parent17de8ffc215d8539860a8a7f06279c4155382c4f (diff)
downloadcpython-2ba96610bfeda03381dd411d5694fae311159a0c.zip
cpython-2ba96610bfeda03381dd411d5694fae311159a0c.tar.gz
cpython-2ba96610bfeda03381dd411d5694fae311159a0c.tar.bz2
SF Patch #1463867: Improved generator finalization to allow generators
that are suspended outside of any try/except/finally blocks to be garbage collected even if they are part of a cycle. Generators that suspend inside of an active try/except or try/finally block (including those created by a ``with`` statement) are still not GC-able if they are part of a cycle, however.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index cc1eb97..6302ede 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2179,6 +2179,9 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throw)
case SETUP_LOOP:
case SETUP_EXCEPT:
case SETUP_FINALLY:
+ /* NOTE: If you add any new block-setup opcodes that are not try/except/finally
+ handlers, you may need to update the PyGen_NeedsFinalizing() function. */
+
PyFrame_BlockSetup(f, opcode, INSTR_OFFSET() + oparg,
STACK_LEVEL());
continue;