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 serhiy.storchaka
Recipients Mark.Shannon, iritkatriel, myzhang1029, serhiy.storchaka
Date 2020-09-24.06:59:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1600930793.16.0.563087189676.issue39934@roundup.psfhosted.org>
In-reply-to
Content
It is a bug. Compiler explicitly checks if the number of nested "try" blocks does not exceed the limit of CO_MAXBLOCKS, but it does not count implicit "try" blocks inserted when your assign an exception in the "except" clause.

    try:
        ...
    except Exception as e:
        ...

is actually translated to

    try:
        ...
    except Exception:
        try:
            e = ...
            ...
        finally:
            e = None
            del e

So we have double number of nested "try" blocks.
History
Date User Action Args
2020-09-24 06:59:53serhiy.storchakasetrecipients: + serhiy.storchaka, Mark.Shannon, myzhang1029, iritkatriel
2020-09-24 06:59:53serhiy.storchakasetmessageid: <1600930793.16.0.563087189676.issue39934@roundup.psfhosted.org>
2020-09-24 06:59:53serhiy.storchakalinkissue39934 messages
2020-09-24 06:59:52serhiy.storchakacreate