New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Python2-style exception handling #90668
Comments
Following bpo-45711 the redundancy in exc_info is now explicit. This means that we can now safely update places that still use python2-style exception handling code, like:
|
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. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: