diff options
Diffstat (limited to 'Python/errors.c')
-rw-r--r-- | Python/errors.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Python/errors.c b/Python/errors.c index e6fa15f..b05b3ef 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -1513,11 +1513,9 @@ write_unraisable_exc_file(PyThreadState *tstate, PyObject *exc_type, } /* Explicitly call file.flush() */ - PyObject *res = PyObject_CallMethodNoArgs(file, &_Py_ID(flush)); - if (!res) { + if (_PyFile_Flush(file) < 0) { return -1; } - Py_DECREF(res); return 0; } |