[issue30238] 2to3 doesn't detect or fix Exception indexing
Daniel Lenski
report at bugs.python.org
Mon Jun 21 17:14:18 EDT 2021
Daniel Lenski <dlenski at gmail.com> added the comment:
> There is no way to know through static analysis that the subscript is on an object of type exception. I think this should be closed as won't fix.
In almost all cases, the variable in question will receive its value via `except ... as e:`.
try:
...
except (Exception1, Exception2, ...) as e:
e[0]
Seems to me that it should be possible for 2to3 to handle this large subset of applicable cases via static analysis.
----------
status: pending -> open
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue30238>
_______________________________________
More information about the Python-bugs-list
mailing list