8000 Fix #5660. No FileNotFoundError on Py2 by mdboom · Pull Request #5661 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Fix #5660. No FileNotFoundError on Py2 #5661

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix #5660. No FileNotFoundError on Py2
  • Loading branch information
mdboom committed Dec 11, 2015
commit 157621b886d8a884c590c6f5b300232f39dcf313
6 changes: 5 additions & 1 deletion lib/matplotlib/dviread.py
Original file line number Diff line number Diff line change
5F2B 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