summaryrefslogtreecommitdiff
path: root/Modules/pyexpat.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/pyexpat.c')
-rw-r--r--Modules/pyexpat.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c
index b3259d57aa..e0c9be732e 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -119,7 +119,7 @@ set_error(xmlparseobject *self, enum XML_Error code)
XML_ErrorString(code), lineno, column);
if (buffer == NULL)
return NULL;
- err = PyObject_CallFunction(ErrorObject, "O", buffer);
+ err = PyObject_CallFunctionObjArgs(ErrorObject, buffer, NULL);
Py_DECREF(buffer);
if ( err != NULL
&& set_error_attr(err, "code", code)
@@ -161,8 +161,7 @@ conv_string_to_unicode(const XML_Char *str)
and hence in UTF-8. */
/* UTF-8 from Expat, Unicode desired */
if (str == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return PyUnicode_DecodeUTF8(str, strlen(str), "strict");
}
@@ -174,8 +173,7 @@ conv_string_len_to_unicode(const XML_Char *str, int len)
and hence in UTF-8. */
/* UTF-8 from Expat, Unicode desired */
if (str == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return PyUnicode_DecodeUTF8((const char *)str, len, "strict");
}
@@ -1030,8 +1028,7 @@ pyexpat_xmlparser_UseForeignDTD_impl(xmlparseobject *self, int flag)
if (rc != XML_ERROR_NONE) {
return set_error(self, rc);
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
#endif
@@ -1322,8 +1319,7 @@ xmlparse_getattro(xmlparseobject *self, PyObject *nameobj)
return get_pybool((long) self->specified_attributes);
if (_PyUnicode_EqualToASCIIString(nameobj, "intern")) {
if (self->intern == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
else {
Py_INCREF(self->intern);
@@ -1984,8 +1980,3 @@ static struct HandlerInfo handler_info[] = {
{NULL, NULL, NULL} /* sentinel */
};
-
-/*[clinic input]
-dump buffer
-[clinic start generated code]*/
-/*[clinic end generated code: output=da39a3ee5e6b4b0d input=524ce2e021e4eba6]*/