From: Victor Stinner Date: Wed, 6 Nov 2013 23:01:51 +0000 (+0100) Subject: Issue #19512: builtin print() function uses an identifier instead of literal X-Git-Tag: v3.4.0b1~360 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eaa2883d15ec7d67b85f125b307116c53566b88b;p=thirdparty%2FPython%2Fcpython.git Issue #19512: builtin print() function uses an identifier instead of literal string "flush" to call the flush method --- diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 6d9864da1757..7f3593c69521 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -1547,6 +1547,7 @@ builtin_print(PyObject *self, PyObject *args, PyObject *kwds) static PyObject *dummy_args; PyObject *sep = NULL, *end = NULL, *file = NULL, *flush = NULL; int i, err; + _Py_IDENTIFIER(flush); if (dummy_args == NULL && !(dummy_args = PyTuple_New(0))) return NULL; @@ -1613,7 +1614,7 @@ builtin_print(PyObject *self, PyObject *args, PyObject *kwds) if (do_flush == -1) return NULL; else if (do_flush) { - tmp = PyObject_CallMethod(file, "flush", ""); + tmp = _PyObject_CallMethodId(file, &PyId_flush, ""); if (tmp == NULL) return NULL; else