summaryrefslogtreecommitdiff
path: root/Objects/bytesobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/bytesobject.c')
-rw-r--r--Objects/bytesobject.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 5d48440960..a30ac0c379 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -549,7 +549,7 @@ format_obj(PyObject *v, const char **pbuf, Py_ssize_t *plen)
/* does it support __bytes__? */
func = _PyObject_LookupSpecial(v, &PyId___bytes__);
if (func != NULL) {
- result = PyObject_CallFunctionObjArgs(func, NULL);
+ result = _PyObject_CallNoArg(func);
Py_DECREF(func);
if (result == NULL)
return NULL;
@@ -2378,10 +2378,10 @@ _PyBytes_FromHex(PyObject *string, int use_bytearray)
end = str + hexlen;
while (str < end) {
/* skip over spaces in the input */
- if (*str == ' ') {
+ if (Py_ISSPACE(*str)) {
do {
str++;
- } while (*str == ' ');
+ } while (Py_ISSPACE(*str));
if (str >= end)
break;
}
@@ -2568,7 +2568,7 @@ bytes_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject_Bytes doesn't do. */
func = _PyObject_LookupSpecial(x, &PyId___bytes__);
if (func != NULL) {
- new = PyObject_CallFunctionObjArgs(func, NULL);
+ new = _PyObject_CallNoArg(func);
Py_DECREF(func);
if (new == NULL)
return NULL;
@@ -3051,10 +3051,7 @@ striter_reduce(striterobject *it)
return Py_BuildValue("N(O)n", _PyObject_GetBuiltin("iter"),
it->it_seq, it->it_index);
} else {
- PyObject *u = PyUnicode_FromUnicode(NULL, 0);
- if (u == NULL)
- return NULL;
- return Py_BuildValue("N(N)", _PyObject_GetBuiltin("iter"), u);
+ return Py_BuildValue("N(())", _PyObject_GetBuiltin("iter"));
}
}