8000 Merge pull request #24415 from story645/ft2err · matplotlib/matplotlib@df761c9 · GitHub
[go: up one dir, main page]

Skip to content

Commit df761c9

Browse files
authored
Merge pull request #24415 from story645/ft2err
made f2tfont error message explicit that it needs path to file
2 parents 9d8fde2 + 06c8679 commit df761c9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/matplotlib/tests/test_font_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def test_find_invalid(tmpdir):
146146

147147
# Not really public, but get_font doesn't expose non-filename constructor.
148148
from matplotlib.ft2font import FT2Font
149-
with pytest.raises(TypeError, match='path or binary-mode file'):
149+
with pytest.raises(TypeError, match='font file or a binary-mode file'):
150150
FT2Font(StringIO())
151151

152152

src/ft2font_wrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ static int PyFT2Font_init(PyFT2Font *self, PyObject *args, PyObject *kwds)
433433
|| !(data = PyObject_CallMethod(filename, "read", "i", 0))
434434
|| !PyBytes_Check(data)) {
435435
PyErr_SetString(PyExc_TypeError,
436-
"First argument must be a path or binary-mode file object");
436+
"First argument must be a path to a font file or a binary-mode file object");
437437
Py_CLEAR(data);
438438
goto exit;
439439
} else {

0 commit comments

Comments
 (0)
0