]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind: s/xrange/range/
authorKefu Chai <kchai@redhat.com>
Wed, 1 Apr 2020 12:20:13 +0000 (20:20 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 14 Jun 2020 08:34:52 +0000 (16:34 +0800)
fortunately, cython does not complain at seeing xrange, but let's drop
the last bit of python2.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit ad2bbbc1edb29d3623299fd25f72458623415a96)

src/pybind/cephfs/cephfs.pyx
src/pybind/rados/rados.pyx

index 1dbc44c1dd11bf1b88bc06f350c6354d53f798c1..916ef81eccc4a2e17d21bfcd6b2d016c10dbd4ff 100644 (file)
@@ -458,7 +458,7 @@ cdef char ** to_bytes_array(list_bytes):
     cdef char **ret = <char **>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] = <char *>list_bytes[i]
     return ret
 
index 790168937311b690bcda219f0fdf218892e2fe56..8d2052c1783f01d061b0f2c9fe946bf615b050ef 100644 (file)
@@ -640,7 +640,7 @@ cdef size_t * to_csize_t_array(list_int):
     cdef size_t *ret = <size_t *>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] = <size_t>list_int[i]
     return ret
 
@@ -649,7 +649,7 @@ cdef char ** to_bytes_array(list_bytes):
     cdef char **ret = <char **>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] = <char *>list_bytes[i]
     return ret