summaryrefslogtreecommitdiff
path: root/gr-utils/python/modtool/gr-newmod
diff options
context:
space:
mode:
Diffstat (limited to 'gr-utils/python/modtool/gr-newmod')
-rw-r--r--gr-utils/python/modtool/gr-newmod/cmake/Modules/GrMiscUtils.cmake10
-rw-r--r--gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake11
-rw-r--r--gr-utils/python/modtool/gr-newmod/cmake/Modules/GrSwig.cmake2
-rw-r--r--gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/__init__.py3
-rw-r--r--gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/base.py18
-rw-r--r--gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/doxyindex.py8
-rw-r--r--gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/__init__.py1
-rw-r--r--gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compound.py8
-rw-r--r--gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compoundsuper.py40
-rw-r--r--gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/index.py6
-rw-r--r--gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py21
-rw-r--r--gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/text.py5
-rw-r--r--gr-utils/python/modtool/gr-newmod/docs/doxygen/swig_doc.py3
-rw-r--r--gr-utils/python/modtool/gr-newmod/python/__init__.py1
-rw-r--r--gr-utils/python/modtool/gr-newmod/python/build_utils.py12
-rw-r--r--gr-utils/python/modtool/gr-newmod/python/build_utils_codes.py1
16 files changed, 87 insertions, 63 deletions
diff --git a/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrMiscUtils.cmake b/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrMiscUtils.cmake
index 50d817aa9e..cc8e7c17dc 100644
--- a/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrMiscUtils.cmake
+++ b/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrMiscUtils.cmake
@@ -341,7 +341,7 @@ if __name__ == '__main__':
add_custom_command(
OUTPUT ${expanded_files_h}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+ COMMAND ${PYTHON_EXECUTABLE} -B
${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
${root} ${root}.h.t ${ARGN}
)
@@ -387,7 +387,7 @@ if __name__ == '__main__':
add_custom_command(
OUTPUT ${expanded_files_cc}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.cc.t
- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+ COMMAND ${PYTHON_EXECUTABLE} -B
${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
${root} ${root}.cc.t ${ARGN}
)
@@ -396,7 +396,7 @@ if __name__ == '__main__':
add_custom_command(
OUTPUT ${expanded_files_h}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}.h.t
- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+ COMMAND ${PYTHON_EXECUTABLE} -B
${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
${root} ${root}.h.t ${ARGN}
)
@@ -450,7 +450,7 @@ if __name__ == '__main__':
add_custom_command(
OUTPUT ${expanded_files_cc_impl}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.cc.t
- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+ COMMAND ${PYTHON_EXECUTABLE} -B
${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
${root} ${root}_impl.cc.t ${ARGN}
)
@@ -459,7 +459,7 @@ if __name__ == '__main__':
add_custom_command(
OUTPUT ${expanded_files_h_impl}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${root}_impl.h.t
- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+ COMMAND ${PYTHON_EXECUTABLE} -B
${CMAKE_CURRENT_BINARY_DIR}/generate_helper.py
${root} ${root}_impl.h.t ${ARGN}
)
diff --git a/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake b/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake
index 0bfa92db8d..6b997c0869 100644
--- a/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake
+++ b/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrPython.cmake
@@ -36,11 +36,12 @@ if(PYTHON_EXECUTABLE)
else(PYTHON_EXECUTABLE)
#use the built-in find script
+ set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6)
find_package(PythonInterp 2)
#and if that fails use the find program routine
if(NOT PYTHONINTERP_FOUND)
- find_program(PYTHON_EXECUTABLE NAMES python python2 python2.7 python2.6 python2.5)
+ find_program(PYTHON_EXECUTABLE NAMES python python2 python2.7)
if(PYTHON_EXECUTABLE)
set(PYTHONINTERP_FOUND TRUE)
endif(PYTHON_EXECUTABLE)
@@ -86,7 +87,7 @@ macro(GR_PYTHON_CHECK_MODULE desc mod cmd have)
try:
import ${mod}
assert ${cmd}
-except ImportError, AssertionError: exit(-1)
+except (ImportError, AssertionError): exit(-1)
except: pass
#########################################"
RESULT_VARIABLE ${have}
@@ -106,7 +107,7 @@ endmacro(GR_PYTHON_CHECK_MODULE)
if(NOT DEFINED GR_PYTHON_DIR)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "
from distutils import sysconfig
-print sysconfig.get_python_lib(plat_specific=True, prefix='')
+print(sysconfig.get_python_lib(plat_specific=True, prefix=''))
" OUTPUT_VARIABLE GR_PYTHON_DIR OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
@@ -119,7 +120,7 @@ file(TO_CMAKE_PATH ${GR_PYTHON_DIR} GR_PYTHON_DIR)
function(GR_UNIQUE_TARGET desc)
file(RELATIVE_PATH reldir ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR})
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import re, hashlib
-unique = hashlib.md5('${reldir}${ARGN}').hexdigest()[:5]
+unique = hashlib.md5(b'${reldir}${ARGN}').hexdigest()[:5]
print(re.sub('\\W', '_', '${desc} ${reldir} ' + unique))"
OUTPUT_VARIABLE _target OUTPUT_STRIP_TRAILING_WHITESPACE)
add_custom_target(${_target} ALL DEPENDS ${ARGN})
@@ -233,7 +234,7 @@ endfunction(GR_PYTHON_INSTALL)
file(WRITE ${CMAKE_BINARY_DIR}/python_compile_helper.py "
import sys, py_compile
files = sys.argv[1:]
-srcs, gens = files[:len(files)/2], files[len(files)/2:]
+srcs, gens = files[:len(files)//2], files[len(files)//2:]
for src, gen in zip(srcs, gens):
py_compile.compile(file=src, cfile=gen, doraise=True)
")
diff --git a/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrSwig.cmake b/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrSwig.cmake
index 543562a287..bce51b23dd 100644
--- a/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrSwig.cmake
+++ b/gr-utils/python/modtool/gr-newmod/cmake/Modules/GrSwig.cmake
@@ -76,7 +76,7 @@ function(GR_SWIG_MAKE_DOCS output_file)
add_custom_command(
OUTPUT ${output_file}
DEPENDS ${input_files} ${stamp-file} ${OUTPUT_DIRECTORY}/xml/index.xml
- COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B}
+ COMMAND ${PYTHON_EXECUTABLE} -B
${CMAKE_SOURCE_DIR}/docs/doxygen/swig_doc.py
${OUTPUT_DIRECTORY}/xml
${output_file}
diff --git a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/__init__.py b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/__init__.py
index 5cd0b3c6c5..b7a8884519 100644
--- a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/__init__.py
+++ b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/__init__.py
@@ -63,8 +63,9 @@ This line is uninformative and is only to test line breaks in the comments.
u'Outputs the vital aadvark statistics.'
"""
+from __future__ import unicode_literals
-from doxyindex import DoxyIndex, DoxyFunction, DoxyParam, DoxyClass, DoxyFile, DoxyNamespace, DoxyGroup, DoxyFriend, DoxyOther
+from .doxyindex import DoxyIndex, DoxyFunction, DoxyParam, DoxyClass, DoxyFile, DoxyNamespace, DoxyGroup, DoxyFriend, DoxyOther
def _test():
import os
diff --git a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/base.py b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/base.py
index e8f026ab90..0f0adf255b 100644
--- a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/base.py
+++ b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/base.py
@@ -24,24 +24,26 @@ A base class is created.
Classes based upon this are used to make more user-friendly interfaces
to the doxygen xml docs than the generated classes provide.
"""
+from __future__ import print_function
+from __future__ import unicode_literals
import os
import pdb
from xml.parsers.expat import ExpatError
-from generated import compound
+from .generated import compound
class Base(object):
- class Duplicate(StandardError):
+ class Duplicate(Exception):
pass
- class NoSuchMember(StandardError):
+ class NoSuchMember(Exception):
pass
- class ParsingError(StandardError):
+ class ParsingError(Exception):
pass
def __init__(self, parse_data, top=None):
@@ -94,7 +96,7 @@ class Base(object):
for cls in self.mem_classes:
if cls.can_parse(mem):
return cls
- raise StandardError(("Did not find a class for object '%s'." \
+ raise Exception(("Did not find a class for object '%s'." \
% (mem.get_name())))
def convert_mem(self, mem):
@@ -102,11 +104,11 @@ class Base(object):
cls = self.get_cls(mem)
converted = cls.from_parse_data(mem, self.top)
if converted is None:
- raise StandardError('No class matched this object.')
+ raise Exception('No class matched this object.')
self.add_ref(converted)
return converted
- except StandardError, e:
- print e
+ except Exception as e:
+ print(e)
@classmethod
def includes(cls, inst):
diff --git a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/doxyindex.py b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/doxyindex.py
index 78e8153768..4284af25ec 100644
--- a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/doxyindex.py
+++ b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/doxyindex.py
@@ -22,12 +22,14 @@
Classes providing more user-friendly interfaces to the doxygen xml
docs than the generated classes provide.
"""
+from __future__ import absolute_import
+from __future__ import unicode_literals
import os
-from generated import index
-from base import Base
-from text import description
+from .generated import index
+from .base import Base
+from .text import description
class DoxyIndex(Base):
"""
diff --git a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/__init__.py b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/__init__.py
index 39823979f6..23095c1f34 100644
--- a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/__init__.py
+++ b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/__init__.py
@@ -5,3 +5,4 @@ These do the real work of parsing the doxygen xml files but the
resultant classes are not very friendly to navigate so the rest of the
doxyxml module processes them further.
"""
+from __future__ import unicode_literals
diff --git a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compound.py b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compound.py
index 1522ac23f1..acfa0dd5c6 100644
--- a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compound.py
+++ b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compound.py
@@ -3,15 +3,17 @@
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
+from __future__ import absolute_import
+from __future__ import unicode_literals
+
-from string import lower as str_lower
from xml.dom import minidom
from xml.dom import Node
import sys
-import compoundsuper as supermod
-from compoundsuper import MixedContainer
+from . import compoundsuper as supermod
+from .compoundsuper import MixedContainer
class DoxygenTypeSub(supermod.DoxygenType):
diff --git a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compoundsuper.py b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compoundsuper.py
index 6255dda163..6e984e13ec 100644
--- a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compoundsuper.py
+++ b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/compoundsuper.py
@@ -4,12 +4,17 @@
# Generated Thu Jun 11 18:44:25 2009 by generateDS.py.
#
+from __future__ import print_function
+from __future__ import unicode_literals
+
import sys
-import getopt
-from string import lower as str_lower
+
from xml.dom import minidom
from xml.dom import Node
+import six
+
+
#
# User methods
#
@@ -19,9 +24,9 @@ from xml.dom import Node
try:
from generatedssuper import GeneratedsSuper
-except ImportError, exp:
+except ImportError as exp:
- class GeneratedsSuper:
+ class GeneratedsSuper(object):
def format_string(self, input_data, input_name=''):
return input_data
def format_integer(self, input_data, input_name=''):
@@ -64,7 +69,7 @@ def showIndent(outfile, level):
outfile.write(' ')
def quote_xml(inStr):
- s1 = (isinstance(inStr, basestring) and inStr or
+ s1 = (isinstance(inStr, six.string_types) and inStr or
'%s' % inStr)
s1 = s1.replace('&', '&')
s1 = s1.replace('<', '&lt;')
@@ -72,7 +77,7 @@ def quote_xml(inStr):
return s1
def quote_attrib(inStr):
- s1 = (isinstance(inStr, basestring) and inStr or
+ s1 = (isinstance(inStr, six.string_types) and inStr or
'%s' % inStr)
s1 = s1.replace('&', '&amp;')
s1 = s1.replace('<', '&lt;')
@@ -102,7 +107,7 @@ def quote_python(inStr):
return '"""%s"""' % s1
-class MixedContainer:
+class MixedContainer(object):
# Constants for category:
CategoryNone = 0
CategoryText = 1
@@ -4221,7 +4226,7 @@ class codelineType(GeneratedsSuper):
if attrs.get('lineno'):
try:
self.lineno = int(attrs.get('lineno').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (lineno): %s' % exp)
if attrs.get('refkind'):
self.refkind = attrs.get('refkind').value
@@ -4504,12 +4509,12 @@ class referenceType(GeneratedsSuper):
if attrs.get('endline'):
try:
self.endline = int(attrs.get('endline').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (endline): %s' % exp)
if attrs.get('startline'):
try:
self.startline = int(attrs.get('startline').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (startline): %s' % exp)
if attrs.get('refid'):
self.refid = attrs.get('refid').value
@@ -4627,17 +4632,17 @@ class locationType(GeneratedsSuper):
if attrs.get('bodystart'):
try:
self.bodystart = int(attrs.get('bodystart').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (bodystart): %s' % exp)
if attrs.get('line'):
try:
self.line = int(attrs.get('line').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (line): %s' % exp)
if attrs.get('bodyend'):
try:
self.bodyend = int(attrs.get('bodyend').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (bodyend): %s' % exp)
if attrs.get('bodyfile'):
self.bodyfile = attrs.get('bodyfile').value
@@ -6778,12 +6783,12 @@ class docTableType(GeneratedsSuper):
if attrs.get('rows'):
try:
self.rows = int(attrs.get('rows').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (rows): %s' % exp)
if attrs.get('cols'):
try:
self.cols = int(attrs.get('cols').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (cols): %s' % exp)
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.ELEMENT_NODE and \
@@ -7108,7 +7113,7 @@ class docHeadingType(GeneratedsSuper):
if attrs.get('level'):
try:
self.level = int(attrs.get('level').value)
- except ValueError, exp:
+ except ValueError as exp:
raise ValueError('Bad integer attribute (level): %s' % exp)
def buildChildren(self, child_, nodeName_):
if child_.nodeType == Node.TEXT_NODE:
@@ -8283,7 +8288,7 @@ Options:
"""
def usage():
- print USAGE_TEXT
+ print(USAGE_TEXT)
sys.exit(1)
@@ -8339,4 +8344,3 @@ if __name__ == '__main__':
main()
#import pdb
#pdb.run('main()')
-
diff --git a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/index.py b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/index.py
index 7a70e14a1a..0c63512119 100644
--- a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/index.py
+++ b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/index.py
@@ -3,14 +3,16 @@
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
+from __future__ import absolute_import
+from __future__ import unicode_literals
from xml.dom import minidom
import os
import sys
-import compound
+from . import compound
-import indexsuper as supermod
+from . import indexsuper as supermod
class DoxygenTypeSub(supermod.DoxygenType):
def __init__(self, version=None, compound=None):
diff --git a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py
index a991530198..11312db635 100644
--- a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py
+++ b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/indexsuper.py
@@ -4,12 +4,16 @@
# Generated Thu Jun 11 18:43:54 2009 by generateDS.py.
#
+from __future__ import print_function
+from __future__ import unicode_literals
+
import sys
-import getopt
-from string import lower as str_lower
+
from xml.dom import minidom
from xml.dom import Node
+import six
+
#
# User methods
#
@@ -19,9 +23,9 @@ from xml.dom import Node
try:
from generatedssuper import GeneratedsSuper
-except ImportError, exp:
+except ImportError as exp:
- class GeneratedsSuper:
+ class GeneratedsSuper(object):
def format_string(self, input_data, input_name=''):
return input_data
def format_integer(self, input_data, input_name=''):
@@ -64,7 +68,7 @@ def showIndent(outfile, level):
outfile.write(' ')
def quote_xml(inStr):
- s1 = (isinstance(inStr, basestring) and inStr or
+ s1 = (isinstance(inStr, six.string_types) and inStr or
'%s' % inStr)
s1 = s1.replace('&', '&amp;')
s1 = s1.replace('<', '&lt;')
@@ -72,7 +76,7 @@ def quote_xml(inStr):
return s1
def quote_attrib(inStr):
- s1 = (isinstance(inStr, basestring) and inStr or
+ s1 = (isinstance(inStr, six.string_types) and inStr or
'%s' % inStr)
s1 = s1.replace('&', '&amp;')
s1 = s1.replace('<', '&lt;')
@@ -102,7 +106,7 @@ def quote_python(inStr):
return '"""%s"""' % s1
-class MixedContainer:
+class MixedContainer(object):
# Constants for category:
CategoryNone = 0
CategoryText = 1
@@ -462,7 +466,7 @@ Options:
"""
def usage():
- print USAGE_TEXT
+ print(USAGE_TEXT)
sys.exit(1)
@@ -520,4 +524,3 @@ if __name__ == '__main__':
main()
#import pdb
#pdb.run('main()')
-
diff --git a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/text.py b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/text.py
index 629edd180d..de2d19b532 100644
--- a/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/text.py
+++ b/gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/text.py
@@ -21,12 +21,13 @@
"""
Utilities for extracting text from generated classes.
"""
+from __future__ import unicode_literals
def is_string(txt):
if isinstance(txt, str):
return True
try:
- if isinstance(txt, unicode):
+ if isinstance(txt, str):
return True
except NameError:
pass
@@ -49,7 +50,7 @@ def description_bit(obj):
elif is_string(obj):
return obj
else:
- raise StandardError('Expecting a string or something with content, content_ or value attribute')
+ raise Exception('Expecting a string or something with content, content_ or value attribute')
# If this bit is a paragraph then add one some line breaks.
if hasattr(obj, 'name') and obj.name == 'para':
result += "\n\n"
diff --git a/gr-utils/python/modtool/gr-newmod/docs/doxygen/swig_doc.py b/gr-utils/python/modtool/gr-newmod/docs/doxygen/swig_doc.py
index d3536db8d0..c735b1291b 100644
--- a/gr-utils/python/modtool/gr-newmod/docs/doxygen/swig_doc.py
+++ b/gr-utils/python/modtool/gr-newmod/docs/doxygen/swig_doc.py
@@ -26,6 +26,7 @@ The file instructs SWIG to transfer the doxygen comments into the
python docstrings.
"""
+from __future__ import unicode_literals
import sys, time
@@ -309,7 +310,7 @@ if __name__ == "__main__":
# Parse command line options and set up doxyxml.
err_msg = "Execute using: python swig_doc.py xml_path outputfilename"
if len(sys.argv) != 3:
- raise StandardError(err_msg)
+ raise Exception(err_msg)
xml_path = sys.argv[1]
swigdocfilename = sys.argv[2]
di = DoxyIndex(xml_path)
diff --git a/gr-utils/python/modtool/gr-newmod/python/__init__.py b/gr-utils/python/modtool/gr-newmod/python/__init__.py
index ed385a0abe..806f287cc3 100644
--- a/gr-utils/python/modtool/gr-newmod/python/__init__.py
+++ b/gr-utils/python/modtool/gr-newmod/python/__init__.py
@@ -22,6 +22,7 @@
This is the GNU Radio HOWTO module. Place your Python package
description here (python/__init__.py).
'''
+from __future__ import unicode_literals
# import swig generated symbols into the howto namespace
try:
diff --git a/gr-utils/python/modtool/gr-newmod/python/build_utils.py b/gr-utils/python/modtool/gr-newmod/python/build_utils.py
index cf58a97637..0b26844cbf 100644
--- a/gr-utils/python/modtool/gr-newmod/python/build_utils.py
+++ b/gr-utils/python/modtool/gr-newmod/python/build_utils.py
@@ -21,15 +21,17 @@
"""Misc utilities used at build time
"""
+from __future__ import absolute_import
+from __future__ import unicode_literals
import re, os, os.path
-from build_utils_codes import *
+from .build_utils_codes import *
# set srcdir to the directory that contains Makefile.am
try:
srcdir = os.environ['srcdir']
-except KeyError, e:
+except KeyError as e:
srcdir = "."
srcdir = srcdir + '/'
@@ -39,7 +41,7 @@ try:
do_makefile = False
else:
do_makefile = True
-except KeyError, e:
+except KeyError as e:
do_makefile = False
# set do_sources to either true or false dependeing on the environment
@@ -48,7 +50,7 @@ try:
do_sources = False
else:
do_sources = True
-except KeyError, e:
+except KeyError as e:
do_sources = True
name_dict = {}
@@ -127,7 +129,7 @@ def extract_extension (template_name):
# we return everything between the penultimate . and .t
mo = re.search (r'\.([a-z]+)\.t$', template_name)
if not mo:
- raise ValueError, "Incorrectly formed template_name '%s'" % (template_name,)
+ raise ValueError("Incorrectly formed template_name '%s'" % (template_name,))
return mo.group (1)
def open_src (name, mode):
diff --git a/gr-utils/python/modtool/gr-newmod/python/build_utils_codes.py b/gr-utils/python/modtool/gr-newmod/python/build_utils_codes.py
index 9ea96baae4..22a6bdb99b 100644
--- a/gr-utils/python/modtool/gr-newmod/python/build_utils_codes.py
+++ b/gr-utils/python/modtool/gr-newmod/python/build_utils_codes.py
@@ -1,3 +1,4 @@
+from __future__ import unicode_literals
#
# Copyright 2004 Free Software Foundation, Inc.
#