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:
Doug Hellmann 2018-06-13 15:38:42 -04:00
parent 0af0802b91
commit bf36aa85bb
1 changed files with 2 additions and 1 deletions

View File

@ -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