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 Dennis Sweeney
Recipients Dennis Sweeney, gchalony
Date 2020-09-25.02:48:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1601002128.64.0.217987969372.issue41850@roundup.psfhosted.org>
In-reply-to
Content
I believe the block stack is only for catching exceptions. Loops do not interact with the block stack. Only SETUP_FINALLY adds to the block stack:

https://docs.python.org/3/library/dis.html#opcode-SETUP_FINALLY

Meanwhile, loops and conditionals and the like are compiled into goto-like jumps.

There may be some existing solution, but I'm not sure what. Maybe look at the traceback or ast modules.
History
Date User Action Args
2020-09-25 02:48:48Dennis Sweeneysetrecipients: + Dennis Sweeney, gchalony
2020-09-25 02:48:48Dennis Sweeneysetmessageid: <1601002128.64.0.217987969372.issue41850@roundup.psfhosted.org>
2020-09-25 02:48:48Dennis Sweeneylinkissue41850 messages
2020-09-25 02:48:48Dennis Sweeneycreate