Avoid calling functions with an empty string as format string

Directly pass NULL rather than an empty string.
This commit is contained in:
Victor Stinner 2016-09-05 18:16:01 -07:00
parent ad8c83ad6b
commit 3466bde1cc
13 changed files with 34 additions and 34 deletions

View file

@ -2137,7 +2137,7 @@ _make_call(void *callable)
PyObject *rc;
int success;
PyGILState_STATE s = PyGILState_Ensure();
rc = PyObject_CallFunction((PyObject *)callable, "");
rc = _PyObject_CallNoArg((PyObject *)callable);
success = (rc != NULL);
Py_XDECREF(rc);
PyGILState_Release(s);
@ -3406,7 +3406,7 @@ temporary_c_thread(void *data)
/* Allocate a Python thread state for this thread */
state = PyGILState_Ensure();
res = PyObject_CallFunction(test_c_thread->callback, "", NULL);
res = _PyObject_CallNoArg(test_c_thread->callback);
Py_CLEAR(test_c_thread->callback);
if (res == NULL) {