mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
gh-109611: Add convenient C API function _PyFile_Flush() (GH-109612)
This commit is contained in:
parent
92af0cc580
commit
b8d1744e7b
11 changed files with 54 additions and 97 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue