Python 3: Replacing unicode with six.text_type for py3 compatibility

The "unicode" type was renamed to "str" in Python 3.
Use six.text_type to make swiftclient compatible with Python 3.

For more information about changes needed for py3
compatibility, see:
https://wiki.openstack.org/wiki/Python3

Change-Id: Ic65607a69935652a1874340928f626fbcc35c014
This commit is contained in:
janonymous 2015-06-28 07:34:18 +05:30
parent 7c716997a8
commit ef467ddee4

View File

@ -102,7 +102,7 @@ class OutputManager(object):
def _print(self, item, stream=None):
if stream is None:
stream = self.print_stream
if six.PY2 and isinstance(item, unicode):
if six.PY2 and isinstance(item, six.text_type):
item = item.encode('utf8')
print(item, file=stream)