]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #19512: builtin print() function uses an identifier instead of literal
authorVictor Stinner <victor.stinner@gmail.com>
Wed, 6 Nov 2013 23:01:51 +0000 (00:01 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Wed, 6 Nov 2013 23:01:51 +0000 (00:01 +0100)
string "flush" to call the flush method

Python/bltinmodule.c

index 6d9864da17575080c7d6eac64b7c6db347beb7fb..7f3593c69521eef0a234f8703e7628869911159d 100644 (file)
@@ -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