replace unicode with six.text_type
The unicode() built-in does not exist under Python 3 so use six.text_type, which is set correctly to str or unicode, instead. Change-Id: I22265e35c04be2fa663b63aac208f7894588d629 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
0af0802b91
commit
bf36aa85bb
@ -18,6 +18,7 @@ from __future__ import print_function
|
||||
import numbers
|
||||
|
||||
import prettytable
|
||||
import six
|
||||
import yaml
|
||||
|
||||
from osc_lib import exceptions as exc
|
||||
@ -192,7 +193,7 @@ def format_dict(dict):
|
||||
def format_list(in_list):
|
||||
string_list = list()
|
||||
for k in in_list:
|
||||
if isinstance(k, unicode):
|
||||
if isinstance(k, six.text_type):
|
||||
key = k.encode('utf-8')
|
||||
else:
|
||||
key = k
|
||||
|
Loading…
x
Reference in New Issue
Block a user