summaryrefslogtreecommitdiffstats
path: root/Modules/_elementtree.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-12-05 16:04:32 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-12-05 16:04:32 (GMT)
commit7bfb42d5b7721ca26e33050d025fec5c43c00058 (patch)
treec1c91a2a34361474de2c02388c8f91d4333f2ea5 /Modules/_elementtree.c
parentd77e5b7211e8daf22f2b3e0df124393bca504c38 (diff)
downloadcpython-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 'Modules/_elementtree.c')
-rw-r--r--Modules/_elementtree.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index 3837ff1..2e0cda7 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -2831,7 +2831,7 @@ expat_set_error(enum XML_Error error_code, Py_ssize_t line, Py_ssize_t column,
if (errmsg == NULL)
return;
- error = _PyObject_CallArg1(st->parseerror_obj, errmsg);
+ error = PyObject_CallFunctionObjArgs(st->parseerror_obj, errmsg, NULL);
Py_DECREF(errmsg);
if (!error)
return;
@@ -2894,7 +2894,7 @@ expat_default_handler(XMLParserObject* self, const XML_Char* data_in,
(TreeBuilderObject*) self->target, value
);
else if (self->handle_data)
- res = _PyObject_CallArg1(self->handle_data, value);
+ res = PyObject_CallFunctionObjArgs(self->handle_data, value, NULL);
else
res = NULL;
Py_XDECREF(res);
@@ -3004,7 +3004,7 @@ expat_data_handler(XMLParserObject* self, const XML_Char* data_in,
/* shortcut */
res = treebuilder_handle_data((TreeBuilderObject*) self->target, data);
else if (self->handle_data)
- res = _PyObject_CallArg1(self->handle_data, data);
+ res = PyObject_CallFunctionObjArgs(self->handle_data, data, NULL);
else
res = NULL;
@@ -3031,7 +3031,7 @@ expat_end_handler(XMLParserObject* self, const XML_Char* tag_in)
else if (self->handle_end) {
tag = makeuniversal(self, tag_in);
if (tag) {
- res = _PyObject_CallArg1(self->handle_end, tag);
+ res = PyObject_CallFunctionObjArgs(self->handle_end, tag, NULL);
Py_DECREF(tag);
}
}
@@ -3090,7 +3090,8 @@ expat_comment_handler(XMLParserObject* self, const XML_Char* comment_in)
if (self->handle_comment) {
comment = PyUnicode_DecodeUTF8(comment_in, strlen(comment_in), "strict");
if (comment) {
- res = _PyObject_CallArg1(self->handle_comment, comment);
+ res = PyObject_CallFunctionObjArgs(self->handle_comment,
+ comment, NULL);
Py_XDECREF(res);
Py_DECREF(comment);
}