From a7cb3634526d17a7f1d19d4a832bef5ebf2dd733 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 19 Mar 2015 12:50:20 -0700 Subject: [PATCH 1/2] Use Python3 syntax for except clause. --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index 15c2c727..6bd74b99 100755 --- a/build.py +++ b/build.py @@ -501,7 +501,7 @@ def getTool(cmdName, version, MD5, envVar, platformBinary): try: p = subprocess.Popen([cmd, '--help'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=os.environ) p.wait() - except OSError, e: + except OSError as e: print('ERROR: Could not execute %s, got "%s"' % (cmd, e)) print(' Set %s in the environment to use a local build of %s instead' % (envVar, cmdName)) sys.exit(1) From 42c661cf54960d8dee6005c83bf949acbd6d257e Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Fri, 20 Mar 2015 10:56:33 -0700 Subject: [PATCH 2/2] More Python3 fixes --- etgtools/sphinx_generator.py | 4 ++-- sphinxtools/utilities.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/etgtools/sphinx_generator.py b/etgtools/sphinx_generator.py index 935f2e81..bba9a381 100644 --- a/etgtools/sphinx_generator.py +++ b/etgtools/sphinx_generator.py @@ -1960,7 +1960,7 @@ class XMLDocString(object): else: raise Exception('Unhandled docstring kind for %s'%xml_item.__class__.__name__) - if hasattr(xml_item, 'deprecated') and xml_item.deprecated and isinstance(xml_item.deprecated, basestring): + if hasattr(xml_item, 'deprecated') and xml_item.deprecated and isinstance(xml_item.deprecated, string_base): element = et.Element('deprecated', kind='deprecated') element.text = VERSION @@ -2610,7 +2610,7 @@ class XMLDocString(object): if hasattr(method, 'deprecated') and method.deprecated: text = method.deprecated - if isinstance(text, basestring): + if isinstance(text, string_base): text = '%s %s\n%s%s\n\n'%(' .. deprecated::', VERSION, ' '*9, text.replace('\n', ' ')) stream.write(text) diff --git a/sphinxtools/utilities.py b/sphinxtools/utilities.py index 9f3afac1..03d872dc 100644 --- a/sphinxtools/utilities.py +++ b/sphinxtools/utilities.py @@ -301,7 +301,7 @@ def PythonizeType(ptype, is_param): else: if is_param and '.' in ptype: - modules = MODULENAME_REPLACE.values() + modules = list(MODULENAME_REPLACE.values()) modules.sort() modules = modules[1:] if ptype.split('.')[0] + '.' in modules: