summaryrefslogtreecommitdiff
path: root/Modules/pyexpat.c
diff options
context:
space:
mode:
authorMariatta Wijaya <mariatta.wijaya@gmail.com>2017-02-06 20:18:39 -0800
committerMariatta Wijaya <mariatta.wijaya@gmail.com>2017-02-06 20:18:39 -0800
commit731cca110f376cdbaffb536e42d6c9d6da574fa8 (patch)
tree9cb95caf6f8b933115820bf699725d9cd600d2df /Modules/pyexpat.c
parentda79bcf8ac7ae72218ab023e1ed54390bc1a3a27 (diff)
parentc8102f4d974669f4c5e4ca7bcd73292a1ac5bcbf (diff)
downloadcpython-731cca110f376cdbaffb536e42d6c9d6da574fa8.tar.gz
Issue #29371: merge with 3.6
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]*/