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

@ -39,6 +39,8 @@ import sys
import time
import ConfigParser
from six import text_type
# Disable logging message trigged by pSphere/suds.
try:
from logging import NullHandler
@ -149,7 +151,7 @@ class VMwareInventory(object):
seen = seen or set()
if isinstance(obj, ManagedObject):
try:
obj_unicode = unicode(getattr(obj, 'name'))
obj_unicode = text_type(getattr(obj, 'name'))
except AttributeError:
obj_unicode = ()
if obj in seen: