Skip to content

Commit

Permalink
Merge pull request matplotlib#5661 from mdboom/filenotfound-py2
Browse files Browse the repository at this point in the history
Fix matplotlib#5660.  No FileNotFoundError on Py2
  • Loading branch information
tacaswell committed Dec 13, 2015
2 parents a56d588 + 157621b commit f9216a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/matplotlib/dviread.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,11 @@ def _fnt_def_real(self, k, c, s, d, a, l):
fontname = n[-l:].decode('ascii')
tfm = _tfmfile(fontname)
if tfm is None:
raise FileNotFoundError("missing font metrics file: %s" % fontname)
if six.PY2:
error_class = OSError
else:
error_class = FileNotFoundError
raise error_class("missing font metrics file: %s" % fontname)
if c != 0 and tfm.checksum != 0 and c != tfm.checksum:
raise ValueError('tfm checksum mismatch: %s' % n)

Expand Down

0 comments on commit f9216a6

Please sign in to comment.