Skip to content

Commit ac328cd

Browse files
committed
add dummy StdOut_Flush() method to make absl logging happy
1 parent 21e3b32 commit ac328cd

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

source/pybase.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ WARRANTIES, see the file, "license.txt," in this distribution.
1818
static PyMethodDef StdOut_Methods[] =
1919
{
2020
{ "write", pybase::StdOut_Write, 1 },
21+
{ "flush", pybase::StdOut_Flush, 1 },
2122
{ NULL, NULL, }
2223
};
2324

@@ -776,6 +777,12 @@ PyObject* pybase::StdOut_Write(PyObject* self, PyObject* args)
776777
return Py_None;
777778
}
778779

780+
// dummy flush method, since some logging libraries call this
781+
PyObject* pybase::StdOut_Flush(PyObject* self, PyObject* args)
782+
{
783+
Py_INCREF(Py_None);
784+
return Py_None;
785+
}
779786

780787
class work_data
781788
{

source/pybase.h

+1
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ class pybase
269269
};
270270

271271
static PyObject* StdOut_Write(PyObject* Self, PyObject* Args);
272+
static PyObject* StdOut_Flush(PyObject* Self, PyObject* Args);
272273
};
273274

274275
#endif

0 commit comments

Comments
 (0)