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

Skip to content

Commit a66b87f

Browse files
committed
Raise more useful error when tfm file is missing
Fixes #4475
1 parent fdf1bb5 commit a66b87f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/dviread.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,8 @@ def _xxx(self, special):
396396

397397
def _fnt_def(self, k, c, s, d, a, l, n):
398398
tfm = _tfmfile(n[-l:].decode('ascii'))
399+
if tfm is None:
400+
raise FileNotFoundError("missing font metrics file: %s" % tfm)
399401
if c != 0 and tfm.checksum != 0 and c != tfm.checksum:
400402
raise ValueError('tfm checksum mismatch: %s'%n)
401403
# It seems that the assumption behind the following check is incorrect:

0 commit comments

Comments
 (0)