Python 3: use six.text_type instead of unicode

Replace 'unicode' with six.text_type, everywhere but in module_utils.
This commit is contained in:
Marius Gedminas 2015-09-04 08:39:08 +03:00
commit 37be9539ff
9 changed files with 20 additions and 14 deletions

View file

@ -27,7 +27,7 @@ from functools import partial
from inspect import getmembers
from io import FileIO
from six import iteritems, string_types
from six import iteritems, string_types, text_type
from jinja2.exceptions import UndefinedError
@ -291,7 +291,7 @@ class Base:
# and make sure the attribute is of the type it should be
if value is not None:
if attribute.isa == 'string':
value = unicode(value)
value = text_type(value)
elif attribute.isa == 'int':
value = int(value)
elif attribute.isa == 'float':