]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind: s/unicode/str/
authorKefu Chai <kchai@redhat.com>
Tue, 1 Sep 2020 12:38:46 +0000 (20:38 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 11 Sep 2020 16:30:54 +0000 (00:30 +0800)
we've migrated to python3, so no "unicode" anymore.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/cephfs/cephfs.pyx
src/pybind/rados/rados.pyx
src/pybind/rbd/rbd.pyx
src/pybind/rgw/rgw.pyx

index d541e00ef6917071cdce1458b4b37fbf8cdd6bd5..c40c2eb06002850b36fd02de591be0ef77cfdca8 100644 (file)
@@ -508,7 +508,7 @@ def decode_cstr(val, encoding="utf-8"):
     Decode a byte string into a Python string.
 
     :param bytes val: byte string
-    :rtype: unicode or None
+    :rtype: str or None
     """
     if val is None:
         return None
index aead26ee0ae9322f47796afe24fa507bbfc0bf70..9089dc32ace82aec7cbf1485a65bca187ef18e5b 100644 (file)
@@ -565,7 +565,7 @@ def cstr(val, name, encoding="utf-8", opt=False):
         return None
     if isinstance(val, bytes):
         return val
-    elif isinstance(val, unicode):
+    elif isinstance(val, str):
         return val.encode(encoding)
     else:
         raise TypeError('%s must be a string' % name)
@@ -580,7 +580,7 @@ def decode_cstr(val, encoding="utf-8"):
     Decode a byte string into a Python string.
 
     :param bytes val: byte string
-    :rtype: unicode or None
+    :rtype: str or None
     """
     if val is None:
         return None
index 6fd4783711b343299e4e3de06d01962388277622..8b7d5403c11a583c2472743ebd8ebefa87b16191 100644 (file)
@@ -1050,7 +1050,7 @@ def decode_cstr(val, encoding="utf-8"):
     Decode a byte string into a Python string.
 
     :param bytes val: byte string
-    :rtype: unicode or None
+    :rtype: str or None
     """
     if val is None:
         return None
index d5db7f5d93c62d517632759e7e5838de237373d6..6e85dd718f5496a79a2dcd080c981b2effd094bd 100644 (file)
@@ -292,7 +292,7 @@ def cstr(val, name, encoding="utf-8", opt=False):
         return None
     if isinstance(val, bytes):
         return val
-    elif isinstance(val, unicode):
+    elif isinstance(val, str):
         return val.encode(encoding)
     else:
         raise TypeError('%s must be a string' % name)