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: I9aa5df72b2248f9bd32e1c49118d0eb889a95691
This commit is contained in:
Vu Cong Tuan 2018-07-05 13:43:54 +07:00
parent df1875aa8f
commit 1d402f078a
1 changed files with 2 additions and 1 deletions

View File

@ -30,6 +30,7 @@ import json
import os
import pwd
import re
import six
import time
import yaml
import tempfile as tmpfilelib
@ -226,7 +227,7 @@ class ConfigTemplateParser(ConfigParser.RawConfigParser):
_temp_item = list(cursect[optname])
del cursect[optname]
cursect[optname] = _temp_item
elif isinstance(cursect[optname], (str, unicode)):
elif isinstance(cursect[optname], six.text_type):
_temp_item = [cursect[optname]]
del cursect[optname]
cursect[optname] = _temp_item