From dab0e8ffbec5a7ed2181fb06c8867ad2b5ac7bad Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Fri, 27 Sep 2024 18:28:10 +0200 Subject: [PATCH] Don't cache exception with traceback reference loop in dviread. Rather, preemptively cache the reference loop by explicitly dropping the traceback. See also db0c7c3. --- lib/matplotlib/dviread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/dviread.py b/lib/matplotlib/dviread.py index 040ca5ef4365..0eae1852a91b 100644 --- a/lib/matplotlib/dviread.py +++ b/lib/matplotlib/dviread.py @@ -504,7 +504,7 @@ def _fnt_def_real(self, k, c, s, d, a, l): # and throw that error in Dvi._read. For Vf, _finalize_packet # checks whether a missing glyph has been used, and in that case # skips the glyph definition. - self.fonts[k] = exc + self.fonts[k] = exc.with_traceback(None) return if c != 0 and tfm.checksum != 0 and c != tfm.checksum: raise ValueError(f'tfm checksum mismatch: {n}')