Serhiy Storchaka <[email protected]> added the comment:
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.
----------
nosy: +Mark.Shannon, serhiy.storchaka
type: behavior -> crash
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39934>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com