From 762f93ff2efd6b7ef0177cad57939c0ab2002eac Mon Sep 17 00:00:00 2001 From: Jeroen Demeyer Date: Mon, 8 Jul 2019 10:19:25 +0200 Subject: bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267) --- Python/pythonrun.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index f1d946a0b0..6089086078 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -978,7 +978,7 @@ _PyErr_Display(PyObject *file, PyObject *exception, PyObject *value, PyObject *t Py_XDECREF(seen); /* Call file.flush() */ - PyObject *res = _PyObject_CallMethodId(file, &PyId_flush, NULL); + PyObject *res = _PyObject_CallMethodIdNoArgs(file, &PyId_flush); if (!res) { /* Silently ignore file.flush() error */ PyErr_Clear(); @@ -1072,7 +1072,7 @@ flush_io(void) f = _PySys_GetObjectId(&PyId_stderr); if (f != NULL) { - r = _PyObject_CallMethodId(f, &PyId_flush, NULL); + r = _PyObject_CallMethodIdNoArgs(f, &PyId_flush); if (r) Py_DECREF(r); else @@ -1080,7 +1080,7 @@ flush_io(void) } f = _PySys_GetObjectId(&PyId_stdout); if (f != NULL) { - r = _PyObject_CallMethodId(f, &PyId_flush, NULL); + r = _PyObject_CallMethodIdNoArgs(f, &PyId_flush); if (r) Py_DECREF(r); else -- cgit v1.2.1