We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 79b3232 + 6a2cc9d commit 1f7b6d1Copy full SHA for 1f7b6d1
src/ft2font_wrapper.cpp
@@ -296,6 +296,8 @@ static unsigned long read_from_file_callback(FT_Stream stream,
296
297
static void close_file_callback(FT_Stream stream)
298
{
299
+ PyObject *type, *value, *traceback;
300
+ PyErr_Fetch(&type, &value, &traceback);
301
PyFT2Font *self = (PyFT2Font *)stream->descriptor.pointer;
302
PyObject *close_result = NULL;
303
if (!(close_result = PyObject_CallMethod(self->py_file, "close", ""))) {
@@ -307,6 +309,7 @@ static void close_file_callback(FT_Stream stream)
307
309
if (PyErr_Occurred()) {
308
310
PyErr_WriteUnraisable((PyObject*)self);
311
}
312
+ PyErr_Restore(type, value, traceback);
313
314
315
static PyTypeObject PyFT2FontType;
0 commit comments