summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-09-06 01:16:01 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-09-06 01:16:01 (GMT)
commit3466bde1cc113750450ffed028cc6fc7c95faedd (patch)
tree231febf716064e61b742a058c60da523c8b30fe3 /Objects
parentad8c83ad6b91bebbc124c0c36e67b9836ca3d90f (diff)
downloadcpython-3466bde1cc113750450ffed028cc6fc7c95faedd.zip
cpython-3466bde1cc113750450ffed028cc6fc7c95faedd.tar.gz
cpython-3466bde1cc113750450ffed028cc6fc7c95faedd.tar.bz2
Avoid calling functions with an empty string as format string
Directly pass NULL rather than an empty string.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/genobject.c2
-rw-r--r--Objects/weakrefobject.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index f4c5b47..104d90b 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;
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c
index f75b1e8..ab6b235 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -453,7 +453,7 @@ proxy_checkref(PyWeakReference *proxy)
method(PyObject *proxy) { \
_Py_IDENTIFIER(special); \
UNWRAP(proxy); \
- return _PyObject_CallMethodId(proxy, &PyId_##special, ""); \
+ return _PyObject_CallMethodId(proxy, &PyId_##special, NULL); \
}