Issue #28858: Remove _PyObject_CallArg1() macro

Replace
   _PyObject_CallArg1(func, arg)
with
   PyObject_CallFunctionObjArgs(func, arg, NULL)

Using the _PyObject_CallArg1() macro increases the usage of the C stack, which
was unexpected and unwanted. PyObject_CallFunctionObjArgs() doesn't have this
issue.
This commit is contained in:
Victor Stinner 2016-12-05 17:04:32 +01:00
parent d77e5b7211
commit 7bfb42d5b7
15 changed files with 25 additions and 26 deletions

View file

@ -322,7 +322,7 @@ PyObject *codec_getstreamcodec(const char *encoding,
if (errors != NULL)
streamcodec = PyObject_CallFunction(codeccls, "Os", stream, errors);
else
streamcodec = _PyObject_CallArg1(codeccls, stream);
streamcodec = PyObject_CallFunctionObjArgs(codeccls, stream, NULL);
Py_DECREF(codecs);
return streamcodec;
}