[issue46510] Update Python2-style exception handling

Kumar Aditya report at bugs.python.org
Tue Jan 25 07:15:36 EST 2022


Kumar Aditya <rahuladitya303 at gmail.com> added the comment:

> It's not my intention here to go on a search-and-destroy mission to remove all calls to sys.exc_info(), that would cause unnecessary code churn. I am reviewing them to see where the call the sys.exc_info is close to other legacy problems/significant complexity/missing tests.

That's my intention too, in argparse it was used to get the currently handled exception value which can be easily accessed by using "as" in exception handling, so it makes sense to change it, not to mention that using exc_info creates a temporary tuple which is of no use in this scenario.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46510>
_______________________________________


More information about the Python-bugs-list mailing list