diff options
author | Clint Byrum <clint@fewbar.com> | 2015-05-15 11:40:37 -0700 |
---|---|---|
committer | Clint Byrum <clint@fewbar.com> | 2015-05-15 11:52:15 -0700 |
commit | 45f88c16268ccf8a6c106b1ea20e84515c74e476 (patch) | |
tree | 3adf708b1898965a5963cb9e5ced6ce2447c6977 /tools | |
parent | 2b86176aafbf93c3492476069a19ee3841d562aa (diff) | |
download | pysaml2-45f88c16268ccf8a6c106b1ea20e84515c74e476.tar.gz |
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.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/parse_xsd2.py | 6 |
1 files changed, 3 insertions, 3 deletions
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: |