Skip to content

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

Merged
timhoffm merged 1 commit into
matplotlib:mainfrom
anntzer:wtn
Sep 28, 2024
Merged

timhoffm merged 1 commit into
matplotlib:mainfrom
anntzer:wtn

Conversation

@anntzer

@anntzer anntzer commented Sep 27, 2024

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

QuLogic commented Sep 28, 2024 •

Copy link
Copy Markdown
Member

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
Copy Markdown
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
@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