diff options
author | Marcus Müller <marcus@hostalia.de> | 2018-06-25 19:28:29 +0200 |
---|---|---|
committer | Marcus Müller <marcus@hostalia.de> | 2018-06-25 19:28:29 +0200 |
commit | 03ae7938351f01313d30a41927ffb77670fcca14 (patch) | |
tree | 586744f0e2b7560dc161f2a7a60030155d43ce8a /gr-utils/python/modtool/parser_cc_block.py | |
parent | d78f7fcd0dadd362fcdc99194da5343a506eb519 (diff) | |
parent | c66aec4dfae559004e88da968d1ce57584e144ee (diff) |
Merge branch 'next_python3' into next
This brings Python3 to `next`.
It also brings
* a bump in SWIG dependency version
* various GRC improvements,
* YAML instead of XML in GRC
* a lot of broken unit tests
Diffstat (limited to 'gr-utils/python/modtool/parser_cc_block.py')
-rw-r--r-- | gr-utils/python/modtool/parser_cc_block.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gr-utils/python/modtool/parser_cc_block.py b/gr-utils/python/modtool/parser_cc_block.py index 703522c8fb..fffdf309d8 100644 --- a/gr-utils/python/modtool/parser_cc_block.py +++ b/gr-utils/python/modtool/parser_cc_block.py @@ -19,6 +19,10 @@ # Boston, MA 02110-1301, USA. # ''' A parser for blocks written in C++ ''' + +from __future__ import print_function +from __future__ import unicode_literals + import re import sys @@ -42,7 +46,7 @@ class ParserCCBlock(object): E.g., for sizeof(int), it will return 'int'. Returns a list! """ if 'gr::io_signature::makev' in iosigcall: - print 'tbi' + print('tbi') raise ValueError return {'type': [_typestr_to_iotype(x) for x in typestr.split(',')], 'vlen': [_typestr_to_vlen(x) for x in typestr.split(',')] @@ -82,15 +86,15 @@ class ParserCCBlock(object): iosig_match.group('intype')) iosig['in']['min_ports'] = iosig_match.group('inmin') iosig['in']['max_ports'] = iosig_match.group('inmax') - except ValueError, Exception: - print "Error: Can't parse input signature." + except Exception: + print("Error: Can't parse input signature.") try: iosig['out'] = _figure_out_iotype_and_vlen(iosig_match.group('outcall'), iosig_match.group('outtype')) iosig['out']['min_ports'] = iosig_match.group('outmin') iosig['out']['max_ports'] = iosig_match.group('outmax') - except ValueError, Exception: - print "Error: Can't parse output signature." + except Exception: + print("Error: Can't parse output signature.") return iosig @@ -213,7 +217,7 @@ class ParserCCBlock(object): try: params_list = _scan_param_list(make_match.end(0)) except ValueError as ve: - print "Can't parse the argument list: ", ve.args[0] + print("Can't parse the argument list: ", ve.args[0]) sys.exit(0) params = [] for plist in params_list: |