diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/fileobject.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 9c24025..0cf2b47 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -529,6 +529,18 @@ PyFile_OpenCode(const char *utf8path) } +int +_PyFile_Flush(PyObject *file) +{ + PyObject *tmp = PyObject_CallMethodNoArgs(file, &_Py_ID(flush)); + if (tmp == NULL) { + return -1; + } + Py_DECREF(tmp); + return 0; +} + + #ifdef __cplusplus } #endif |