This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients Anssi.Kääriäinen, amaury.forgeotdarc, benjamin.peterson, docs@python, isoschiz, ncoghlan, pconnell, pitrou, vstinner
Date 2013-04-20.15:12:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
To get back to Anssi's original suggestion... I think Anssi's proposal to allow finalisation to be skipped for try/except/else is legitimate. It's only finally clauses that we try to guarantee will execute, there's no such promise implied for ordinary except clauses.

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.
Date User Action Args
2013-04-20 15:12:20ncoghlansetrecipients: + ncoghlan, amaury.forgeotdarc, pitrou, vstinner, benjamin.peterson, docs@python, Anssi.Kääriäinen, pconnell, isoschiz
2013-04-20 15:12:20ncoghlansetmessageid: <>
2013-04-20 15:12:20ncoghlanlinkissue17468 messages
2013-04-20 15:12:20ncoghlancreate