Message187437
> We *don't care* if the generator *would* have caught the thrown
> GeneratorExit, we only care about ensuring that finally blocks are
> executed (including those implied by with statements). So if there
> aren't any finally clauses or with statements in the block stack, we
> should be able to just let the generator and frame get collected (as
> Anssi suggested), without trying to allow execution to complete.
That's a good point.
I'm also contemplating that the generator close() could be done from the
*frame*'s tp_clear, which would sidestep the issue of collect order
entirely: the finally block doesn't actually need the generator to
execute, it only needs the frame and its locals. |
|
Date |
User |
Action |
Args |
2013-04-20 15:53:29 | pitrou | set | recipients:
+ pitrou, amaury.forgeotdarc, ncoghlan, vstinner, benjamin.peterson, docs@python, Anssi.Kääriäinen, pconnell, isoschiz |
2013-04-20 15:53:29 | pitrou | link | issue17468 messages |
2013-04-20 15:53:29 | pitrou | create | |
|