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
Simplify exception handling in doctest.py
#90689
Comments
Right now there are two places where
There are also places where it is exposed as a part of public API (I am not going to change that, at least in this PR):
And some private APIs (out of scope as well):
PR is on its way! |
I don't think this is worth doing in a module where we can't completely get rid of the exc_info triplet. |
In other words, I don't see why it's an improvement to replace exception = sys.exc_info() by exception = type(exc), exc, exc.__traceback__ when sys.exc_info() does exactly what your inlined version does. |
Fair enough! The only improvement is that we don't call Lines 2641 to 2644 in 6e5a193
But, I think it is a minor thing. Looks like I've misunderstood the long time goal of |
In the long term we will want to not have the triplet, but this is a process that will take a few python versions to complete (when 3.11 is the oldest supported version). And it is not going to be simple. In the meantime, where there is an advantage to removing exc_info because the code would be simplified or something else is changing nearby, we can do it. But I wouldn't remove exc_info just for the sake of it - such code churn makes it hard to backport other changes. |
doctest.py
#30916Note: 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: