Skip to content

Commit

Permalink
Replaced deprecated Py_FileSystemDefaultEncoding
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed May 27, 2023
1 parent 117618b commit cda44e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/_imagingft.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,25 @@ getfont(PyObject *self_, PyObject *args, PyObject *kw) {
return NULL;
}

PyConfig config;
PyConfig_InitPythonConfig(&config);
if (!PyArg_ParseTupleAndKeywords(
args,
kw,
"etf|nsy#n",
kwlist,
Py_FileSystemDefaultEncoding,
config.filesystem_encoding,
&filename,
&size,
&index,
&encoding,
&font_bytes,
&font_bytes_size,
&layout_engine)) {
PyConfig_Clear(&config);
return NULL;
}
PyConfig_Clear(&config);

self = PyObject_New(FontObject, &Font_Type);
if (!self) {
Expand Down

0 comments on commit cda44e2

Please sign in to comment.