From ad2bbbc1edb29d3623299fd25f72458623415a96 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 1 Apr 2020 20:20:13 +0800 Subject: [PATCH] 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 --- src/pybind/cephfs/cephfs.pyx | 2 +- src/pybind/rados/rados.pyx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pybind/cephfs/cephfs.pyx b/src/pybind/cephfs/cephfs.pyx index 8cff37c46d0..0c322a7b6be 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 79016893731..8d2052c1783 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 -- 2.47.3