Python 3: use six.string_types instead of basestring

In Python 3, there is no "basestring". In Python 3, "six.string_types" is
"basestring", and "str" in Python 3.

Change-Id: Ic22e932cbf3c4b75cd424f4b41428da869f197cf
Blueprint: neutron-python3
This commit is contained in:
Cyril Roelandt 2015-05-20 15:09:13 +02:00
parent 448007481d
commit 5be084393b
1 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@ import uuid
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import excutils
import six
from neutron.agent.common import utils
from neutron.agent.ovsdb import api as ovsdb
@ -255,7 +256,7 @@ def _set_colval_args(*col_values):
args += ["%s:%s%s%s" % (
col, k, op, _py_to_val(v)) for k, v in val.items()]
elif (isinstance(val, collections.Sequence)
and not isinstance(val, basestring)):
and not isinstance(val, six.string_types)):
args.append("%s%s%s" % (col, op, ",".join(map(_py_to_val, val))))
else:
args.append("%s%s%s" % (col, op, _py_to_val(val)))