summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/examples/volk_benchmark/volk_math.py
diff options
context:
space:
mode:
authorDouglas Anderson <danderson@ntia.doc.gov>2017-02-12 15:52:19 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2017-02-26 18:21:22 -0800
commit9e625c4821f4c63421b3d3747c0c4f358fef6c5f (patch)
tree41dedbe053417be7314cdce15d64fbbb89db4d8d /gnuradio-runtime/examples/volk_benchmark/volk_math.py
parente5aabcc6a4a9335f3ef8abf5f89104b626e9364d (diff)
python3: update non-GRC components to use python2 or python3
Diffstat (limited to 'gnuradio-runtime/examples/volk_benchmark/volk_math.py')
-rw-r--r--[-rwxr-xr-x]gnuradio-runtime/examples/volk_benchmark/volk_math.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/gnuradio-runtime/examples/volk_benchmark/volk_math.py b/gnuradio-runtime/examples/volk_benchmark/volk_math.py
index 753257c237..6fc6cfa78d 100755..100644
--- a/gnuradio-runtime/examples/volk_benchmark/volk_math.py
+++ b/gnuradio-runtime/examples/volk_benchmark/volk_math.py
@@ -1,5 +1,7 @@
#!/usr/bin/env python
+from __future__ import print_function
+from __future__ import unicode_literals
from gnuradio import gr
from gnuradio import blocks
import argparse
@@ -87,7 +89,7 @@ def run_tests(func, N, iters):
res = format_results(func.__name__, t)
return res
except AttributeError:
- print "\tCould not run test. Skipping."
+ print("\tCould not run test. Skipping.")
return None
def main():
@@ -119,7 +121,7 @@ def main():
default=20,
help='Number of iterations [default: %(default)s]')
parser.add_argument('--tests', type=int, nargs='*',
- choices=xrange(len(avail_tests)),
+ choices=list(range(len(avail_tests))),
help='A list of tests to run; can be a single test or a \
space-separated list.')
parser.add_argument('--list', action='store_true',
@@ -129,8 +131,8 @@ def main():
args = parser.parse_args()
if(args.list):
- print "Available Tests to Run:"
- print "\n".join(["\t{0}: {1}".format(i,f.__name__) for i,f in enumerate(avail_tests)])
+ print("Available Tests to Run:")
+ print("\n".join(["\t{0}: {1}".format(i,f.__name__) for i,f in enumerate(avail_tests)]))
sys.exit(0)
N = int(args.nitems)
@@ -141,7 +143,7 @@ def main():
new_table(conn, label)
if args.all:
- tests = xrange(len(avail_tests))
+ tests = list(range(len(avail_tests)))
else:
tests = args.tests