summaryrefslogtreecommitdiff
path: root/Objects/bytesobject.c
diff options
context:
space:
mode:
author?ukasz Langa <lukasz@langa.pl>2017-02-10 00:20:16 -0800
committer?ukasz Langa <lukasz@langa.pl>2017-02-10 00:20:16 -0800
commit8972587fab93cd27ac78b4eab3805f5e11164cb9 (patch)
tree3b6b18367a3054c41f3a186d60c321ef9a08ee38 /Objects/bytesobject.c
parentc7a3f78cc193bfa7fc874f49ec2e0799b32da817 (diff)
parent2328d19475109a50de26fa42832a5286824b0391 (diff)
downloadcpython-8972587fab93cd27ac78b4eab3805f5e11164cb9.tar.gz
Merge 3.6 (fix #29519)
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"));
}
}