Skip to content

Don't cache exception with traceback reference loop in dviread. #28899

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

Merged
merged 1 commit into from
Sep 28, 2024

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Sep 27, 2024

Rather, preemptively cache the reference loop by explicitly dropping the traceback.

See also db0c7c3 (#25470) for a longer description of the problem in another context.

(@tacaswell: I wonder whether using with_traceback(None) would have been a cleaner solution in #25470?)

PR summary

PR checklist

Rather, preemptively cache the reference loop by explicitly dropping
the traceback.

See also db0c7c3.
@timhoffm
Copy link
Member

Do you know that passing None is allowed and not only works by chance? AFAICS, the docs only speak about passing another trackback. If this is not officially supported, we run into the danger that future Python versions break the solution.

@QuLogic
Copy link
Member

QuLogic commented Sep 28, 2024

Not sure about docs, but it is type hinted as accepting None:
https://github.com/python/typeshed/blob/119cd09655dcb4ed7fb2021654ba809b8d88846f/stdlib/builtins.pyi#L1877

@timhoffm
Copy link
Member

Ok, in that case it should be fine.

@timhoffm timhoffm added this to the v3.10.0 milestone Sep 28, 2024
@timhoffm timhoffm merged commit bb68469 into matplotlib:main Sep 28, 2024
40 of 42 checks passed
@anntzer anntzer deleted the wtn branch September 28, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants