summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-09-05 18:16:01 -0700
committerVictor Stinner <victor.stinner@gmail.com>2016-09-05 18:16:01 -0700
commit3466bde1cc113750450ffed028cc6fc7c95faedd (patch)
tree231febf716064e61b742a058c60da523c8b30fe3 /Objects/genobject.c
parentAvoid inefficient way to call functions without argument (diff)
downloadcpython-3466bde1cc113750450ffed028cc6fc7c95faedd.tar.gz
cpython-3466bde1cc113750450ffed028cc6fc7c95faedd.tar.bz2
cpython-3466bde1cc113750450ffed028cc6fc7c95faedd.zip
Avoid calling functions with an empty string as format string
Directly pass NULL rather than an empty string.
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r--Objects/genobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index f4c5b47b8a1..104d90b3e6c 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -261,7 +261,7 @@ gen_close_iter(PyObject *yf)
PyErr_WriteUnraisable(yf);
PyErr_Clear();
} else {
- retval = PyObject_CallFunction(meth, "");
+ retval = _PyObject_CallNoArg(meth);
Py_DECREF(meth);
if (retval == NULL)
return -1;