Skip to content

Commit

Permalink
Python 3: Replacing unicode with six.text_type for py3 compatibility
Browse files Browse the repository at this point in the history
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
  • Loading branch information
codevulture committed Jun 28, 2015
1 parent 7c71699 commit ef467dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion swiftclient/multithreading.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def get_error_count(self):
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)

Expand Down

0 comments on commit ef467dd

Please sign in to comment.