mirror of
https://github.com/python/cpython.git
synced 2026-01-04 14:32:21 +00:00
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:
parent
d77e5b7211
commit
7bfb42d5b7
15 changed files with 25 additions and 26 deletions
|
|
@ -476,7 +476,7 @@ warn_explicit(PyObject *category, PyObject *message,
|
|||
}
|
||||
else {
|
||||
text = message;
|
||||
message = _PyObject_CallArg1(category, message);
|
||||
message = PyObject_CallFunctionObjArgs(category, message, NULL);
|
||||
if (message == NULL)
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ _PyErr_CreateException(PyObject *exception, PyObject *value)
|
|||
return PyObject_Call(exception, value, NULL);
|
||||
}
|
||||
else {
|
||||
return _PyObject_CallArg1(exception, value);
|
||||
return PyObject_CallFunctionObjArgs(exception, value, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2325,7 +2325,7 @@ sys_pyfile_write_unicode(PyObject *unicode, PyObject *file)
|
|||
if (writer == NULL)
|
||||
goto error;
|
||||
|
||||
result = _PyObject_CallArg1(writer, unicode);
|
||||
result = PyObject_CallFunctionObjArgs(writer, unicode, NULL);
|
||||
if (result == NULL) {
|
||||
goto error;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue