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 1f7b6d1

Browse filesBrowse files
authored
Merge pull request #21407 from anntzer/cfe
Stash exceptions when FT2Font closes the underlying stream.
2 parents 79b3232 + 6a2cc9d commit 1f7b6d1
Copy full SHA for 1f7b6d1

File tree

1 file changed

+3
-0
lines changed
Filter options

1 file changed

+3
-0
lines changed

‎src/ft2font_wrapper.cpp

Copy file name to clipboardExpand all lines: src/ft2font_wrapper.cpp
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ static unsigned long read_from_file_callback(FT_Stream stream,
296296

297297
static void close_file_callback(FT_Stream stream)
298298
{
299+
PyObject *type, *value, *traceback;
300+
PyErr_Fetch(&type, &value, &traceback);
299301
PyFT2Font *self = (PyFT2Font *)stream->descriptor.pointer;
300302
PyObject *close_result = NULL;
301303
if (!(close_result = PyObject_CallMethod(self->py_file, "close", ""))) {
@@ -307,6 +309,7 @@ static void close_file_callback(FT_Stream stream)
307309
if (PyErr_Occurred()) {
308310
PyErr_WriteUnraisable((PyObject*)self);
309311
}
312+
PyErr_Restore(type, value, traceback);
310313
}
311314

312315
static PyTypeObject PyFT2FontType;

0 commit comments

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