From: Kefu Chai Date: Wed, 1 Apr 2020 12:20:13 +0000 (+0800) Subject: pybind: s/xrange/range/ X-Git-Tag: v15.2.4~42^2~60 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e6a8c97d8716b7744dec74041ccd3e3d598682e4;p=ceph.git pybind: s/xrange/range/ fortunately, cython does not complain at seeing xrange, but let's drop the last bit of python2. Signed-off-by: Kefu Chai (cherry picked from commit ad2bbbc1edb29d3623299fd25f72458623415a96) --- diff --git a/src/pybind/cephfs/cephfs.pyx b/src/pybind/cephfs/cephfs.pyx index 1dbc44c1dd11..916ef81eccc4 100644 --- a/src/pybind/cephfs/cephfs.pyx +++ b/src/pybind/cephfs/cephfs.pyx @@ -458,7 +458,7 @@ cdef char ** to_bytes_array(list_bytes): cdef char **ret = malloc(len(list_bytes) * sizeof(char *)) if ret == NULL: raise MemoryError("malloc failed") - for i in xrange(len(list_bytes)): + for i in range(len(list_bytes)): ret[i] = list_bytes[i] return ret diff --git a/src/pybind/rados/rados.pyx b/src/pybind/rados/rados.pyx index 790168937311..8d2052c1783f 100644 --- a/src/pybind/rados/rados.pyx +++ b/src/pybind/rados/rados.pyx @@ -640,7 +640,7 @@ cdef size_t * to_csize_t_array(list_int): cdef size_t *ret = malloc(len(list_int) * sizeof(size_t)) if ret == NULL: raise MemoryError("malloc failed") - for i in xrange(len(list_int)): + for i in range(len(list_int)): ret[i] = list_int[i] return ret @@ -649,7 +649,7 @@ cdef char ** to_bytes_array(list_bytes): cdef char **ret = malloc(len(list_bytes) * sizeof(char *)) if ret == NULL: raise MemoryError("malloc failed") - for i in xrange(len(list_bytes)): + for i in range(len(list_bytes)): ret[i] = list_bytes[i] return ret