Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f9216a6

Browse filesBrowse files
committed
Merge pull request #5661 from mdboom/filenotfound-py2
Fix #5660. No FileNotFoundError on Py2
2 parents a56d588 + 157621b commit f9216a6
Copy full SHA for f9216a6

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed

‎lib/matplotlib/dviread.py

Copy file name to clipboardExpand all lines: lib/matplotlib/dviread.py
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,11 @@ def _fnt_def_real(self, k, c, s, d, a, l):
451451
fontname = n[-l:].decode('ascii')
452452
tfm = _tfmfile(fontname)
453453
if tfm is None:
454-
raise FileNotFoundError("missing font metrics file: %s" % fontname)
454+
if six.PY2:
455+
error_class = OSError
456+
else:
457+
error_class = FileNotFoundError
458+
raise error_class("missing font metrics file: %s" % fontname)
455459
if c != 0 and tfm.checksum != 0 and c != tfm.checksum:
456460
raise ValueError('tfm checksum mismatch: %s' % n)
457461

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.