summaryrefslogtreecommitdiff
path: root/Objects/bytesobject.c
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2017-02-09 16:09:03 +0100
committerNick Coghlan <ncoghlan@gmail.com>2017-02-09 16:09:03 +0100
commit2a1d833d5da7fa7a01a2eef183b0a208ed019427 (patch)
tree8da3ebb695ae55c69d0a58691403fb13d96a9476 /Objects/bytesobject.c
parentc6180bb73c8c7c7f9d8ea9816487b710597b6fc1 (diff)
parentbbd3587a29510bd5a318e0a19fc8570c0cd3b622 (diff)
downloadcpython-2a1d833d5da7fa7a01a2eef183b0a208ed019427.tar.gz
Merge issue #26355 fix from 3.6
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"));
}
}