we've migrated to python3, so no "unicode" anymore.
Signed-off-by: Kefu Chai <kchai@redhat.com>
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
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)
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
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
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)