]> git.apps.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>
Tue, 7 Apr 2020 12:33:47 +0000 (20:33 +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>
src/pybind/cephfs/cephfs.pyx
src/pybind/rados/rados.pyx

index 8cff37c46d0df35bd94176b2293af54d78d863b3..0c322a7b6bebc2040e52520e93b80bde57c03855 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