From 45f88c16268ccf8a6c106b1ea20e84515c74e476 Mon Sep 17 00:00:00 2001 From: Clint Byrum Date: Fri, 15 May 2015 11:40:37 -0700 Subject: Use six.string_types instead of basestring In python3 strings are different, so basestring isn't available anymore. While examining these uses, all of them still work fine with six.string_types and should not need any new special handling to deal with bytes. --- tools/parse_xsd2.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/parse_xsd2.py b/tools/parse_xsd2.py index 43c69c3d..a5a22759 100755 --- a/tools/parse_xsd2.py +++ b/tools/parse_xsd2.py @@ -355,7 +355,7 @@ class PyObj(object): line.append("%sc_namespace = NAMESPACE" % (INDENT,)) try: if self.value_type: - if isinstance(self.value_type, basestring): + if isinstance(self.value_type, six.string_types): line.append("%sc_value_type = '%s'" % (INDENT, self.value_type)) else: @@ -593,7 +593,7 @@ def _do(obj, target_namespace, cdict, prep): else: obj.done = True if req: - if isinstance(req, basestring): + if isinstance(req, six.string_types): prep.append(req) else: prep.extend(req) @@ -1643,7 +1643,7 @@ def output(elem, target_namespace, eldict, ignore=None): for prep in preps: if prep: done = 1 - if isinstance(prep, basestring): + if isinstance(prep, six.string_types): print(prep) else: for item in prep: -- cgit v1.2.1