Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d7edc1c

Browse files
committed
Fix font name in error message
1 parent a66b87f commit d7edc1c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/matplotlib/dviread.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,17 +395,18 @@ def _xxx(self, special):
395395
'debug')
396396

397397
def _fnt_def(self, k, c, s, d, a, l, n):
398-
tfm = _tfmfile(n[-l:].decode('ascii'))
398+
fontname = n[-l:].decode('ascii')
399+
tfm = _tfmfile(fontname)
399400
if tfm is None:
400-
raise FileNotFoundError("missing font metrics file: %s" % tfm)
401+
raise FileNotFoundError("missing font metrics file: %s" % fontname)
401402
if c != 0 and tfm.checksum != 0 and c != tfm.checksum:
402403
raise ValueError('tfm checksum mismatch: %s'%n)
403404
# It seems that the assumption behind the following check is incorrect:
404405
#if d != tfm.design_size:
405406
# raise ValueError, 'tfm design size mismatch: %d in dvi, %d in %s'%\
406407
# (d, tfm.design_size, n)
407408

408-
vf = _vffile(n[-l:].decode('ascii'))
409+
vf = _vffile(fontname)
409410

410411
self.fonts[k] = DviFont(scale=s, tfm=tfm, texname=n, vf=vf)
411412

0 commit comments

Comments
 (0)