Mercurial > cpython-lru_cache-weakref
diff Python/ceval.c @ 37564:c782cf6b516e legacy-trunk
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.
| author | Phillip J. Eby <pje@telecommunity.com> |
|---|---|
| date | Mon, 10 Apr 2006 17:51:05 +0000 |
| parents | ab3efbca5c92 |
| children | 2b2e9c388fbb |
line wrap: on
line diff
--- a/Python/ceval.c Mon Apr 10 15:55:37 2006 +0000 +++ b/Python/ceval.c Mon Apr 10 17:51:05 2006 +0000 @@ -2179,6 +2179,9 @@ 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;
