diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-06 23:01:51 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-06 23:01:51 (GMT) |
commit | eaa2883d15ec7d67b85f125b307116c53566b88b (patch) | |
tree | fa071853bf4c06a99a35d3b71f91e12d8d3e1aee /Python/bltinmodule.c | |
parent | e7f516cbb8d446abe1f5c544afa8de1fe5dbb7bc (diff) | |
download | cpython-eaa2883d15ec7d67b85f125b307116c53566b88b.zip cpython-eaa2883d15ec7d67b85f125b307116c53566b88b.tar.gz cpython-eaa2883d15ec7d67b85f125b307116c53566b88b.tar.bz2 |
Issue #19512: builtin print() function uses an identifier instead of literal
string "flush" to call the flush method
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 6d9864d..7f3593c 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 |