diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-12-05 16:04:32 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-12-05 16:04:32 (GMT) |
commit | 7bfb42d5b7721ca26e33050d025fec5c43c00058 (patch) | |
tree | c1c91a2a34361474de2c02388c8f91d4333f2ea5 /Python | |
parent | d77e5b7211e8daf22f2b3e0df124393bca504c38 (diff) | |
download | cpython-7bfb42d5b7721ca26e33050d025fec5c43c00058.zip cpython-7bfb42d5b7721ca26e33050d025fec5c43c00058.tar.gz cpython-7bfb42d5b7721ca26e33050d025fec5c43c00058.tar.bz2 |
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.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/_warnings.c | 2 | ||||
-rw-r--r-- | Python/codecs.c | 2 | ||||
-rw-r--r-- | Python/errors.c | 2 | ||||
-rw-r--r-- | Python/sysmodule.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c index cecc8ad..189bf70 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -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; } diff --git a/Python/codecs.c b/Python/codecs.c index 55f6ca8..688a40b 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -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; } diff --git a/Python/errors.c b/Python/errors.c index 01304d2..74283c9 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -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); } } diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 98a6674..416a02b 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -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 { |