aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2019-07-18 14:35:49 -0700
committerMartin Braun <martin.braun@ettus.com>2019-07-20 14:41:00 -0700
commit3e4ee0758141c405d6c744e077b7d204662914ed (patch)
tree0e0ed051263e5794f31d73ccf17e069fa7e419f7 /host
parent2cba1407059049dfbcdb4bf164967aa62e9ee32a (diff)
downloaduhd-3e4ee0758141c405d6c744e077b7d204662914ed.tar.gz
uhd-3e4ee0758141c405d6c744e077b7d204662914ed.tar.bz2
uhd-3e4ee0758141c405d6c744e077b7d204662914ed.zip
convert: benchmark: Make converter benchmark Py3k compatible
Diffstat (limited to 'host')
-rw-r--r--host/utils/converter_benchmark.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/host/utils/converter_benchmark.py b/host/utils/converter_benchmark.py
index c24c1f983..5e6cba11c 100644
--- a/host/utils/converter_benchmark.py
+++ b/host/utils/converter_benchmark.py
@@ -13,6 +13,7 @@ from __future__ import print_function
import argparse
import csv
import subprocess
+from six import iteritems
INTRO_SETUP = {
'n_samples': {
@@ -38,7 +39,7 @@ TABLE_SETUP = {
def run_benchmark(args):
""" Run the tool with the given arguments, return the section in the {{{ }}} brackets """
call_args = ['./converter_benchmark',]
- for k, v in args.__dict__.iteritems():
+ for k, v in iteritems(args.__dict__):
k = k.replace('_', '-')
if v is None:
continue
@@ -50,7 +51,7 @@ def run_benchmark(args):
call_args.append(str(v))
print(call_args)
try:
- output = subprocess.check_output(call_args)
+ output = subprocess.check_output(call_args).decode('utf-8')
except subprocess.CalledProcessError as ex:
print(ex.output)
exit(ex.returncode)
@@ -64,12 +65,12 @@ def print_stats_table(args, csv_output):
Print stats.
"""
reader = csv.reader(csv_output.strip().split('\n'), delimiter=',')
- title_row = reader.next()
+ title_row = next(reader)
row_widths = [0,] * len(TABLE_SETUP)
for idx, row in enumerate(reader):
if idx == 0:
# Print intro:
- for k, v in INTRO_SETUP.iteritems():
+ for k, v in iteritems(INTRO_SETUP):
print("{title}: {value}".format(
title=v['title'],
value=row[title_row.index(k)],