summaryrefslogtreecommitdiff
path: root/gr-blocks/python/blocks/qa_bin_statistics.py
diff options
context:
space:
mode:
authorAndrej Rode <mail@andrejro.de>2018-06-23 23:41:42 +0200
committerAndrej Rode <mail@andrejro.de>2018-06-24 00:03:35 +0200
commit167a6152bad060fc53dd29e0fa79ef83eff1be5b (patch)
treea01049672d9d7d1bf3d295ed96698a323941f8e8 /gr-blocks/python/blocks/qa_bin_statistics.py
parent3c8e6008b092287246234001db7cf1a4038300da (diff)
parentfcd002b6ac82e1e0c1224e24506410ff0833e1aa (diff)
Merge branch 'python3_fix' into next
Manual merge conflict resolution has been applied to following conflicts: * Typos: * gnuradio-runtime/python/gnuradio/ctrlport/GrDataPlotter.py * gr-blocks/python/blocks/qa_wavfile.py * gr-filter/examples/gr_filtdes_api.py * grc/blocks/parameter.xml * gr-uhd/python/uhd/__init__.py * ValueError -> RuntimeError: * gr-blocks/python/blocks/qa_hier_block2.py * relative Imports & other Py3k: * gr-digital/python/digital/psk_constellations.py * gr-digital/python/digital/qam_constellations.py * gr-digital/python/digital/test_soft_decisions.py * gr-digital/python/digital/gfsk.py * SequenceCompleter: * gr-utils/python/modtool/modtool_add.py * gr-utils/python/modtool/modtool_rename.py * gr-utils/python/modtool/modtool_rm.py * Updated API on next: * gr-blocks/grc/blocks_file_source.xml * gr-blocks/python/blocks/qa_file_source_sink.py * gr-qtgui/grc/qtgui_time_sink_x.xml * GRC Py3k Updates: * grc/core/Block.py * grc/core/Constants.py * grc/core/Platform.py * grc/core/utils/odict.py * grc/gui/Actions.py * grc/gui/Block.py * grc/gui/Executor.py * grc/gui/Port.py
Diffstat (limited to 'gr-blocks/python/blocks/qa_bin_statistics.py')
-rw-r--r--[-rwxr-xr-x]gr-blocks/python/blocks/qa_bin_statistics.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/gr-blocks/python/blocks/qa_bin_statistics.py b/gr-blocks/python/blocks/qa_bin_statistics.py
index 52b8585721..e6bdfaca5b 100755..100644
--- a/gr-blocks/python/blocks/qa_bin_statistics.py
+++ b/gr-blocks/python/blocks/qa_bin_statistics.py
@@ -20,17 +20,21 @@
# Boston, MA 02110-1301, USA.
#
-from gnuradio import gr, gr_unittest, blocks
-
-import random
-import struct
-
"""
Note: There has been an issue with this block in the past, see Issue
#199. This test is being enabled only on the 'next' branch for version
v3.7 for now. TWR
"""
+from __future__ import print_function
+
+import struct
+
+import six
+
+from gnuradio import gr, gr_unittest, blocks
+
+
class counter(gr.feval_dd):
def __init__(self, step_size=1):
gr.feval_dd.__init__(self)
@@ -57,8 +61,8 @@ class counter3(gr.feval_dd):
t = self.count
self.count = self.count + self.step_size
self.f(self.count)
- except Exception, e:
- print "Exception: ", e
+ except Exception as e:
+ print("Exception: ", e)
return t
def foobar3(new_t):
@@ -79,8 +83,8 @@ class counter4(gr.feval_dd):
t = self.count
self.count = self.count + self.step_size
self.obj_instance.foobar4(self.count)
- except Exception, e:
- print "Exception: ", e
+ except Exception as e:
+ print("Exception: ", e)
return t
@@ -89,7 +93,8 @@ class parse_msg(object):
self.center_freq = msg.arg1()
self.vlen = int(msg.arg2())
assert(msg.length() == self.vlen * gr.sizeof_float)
- self.data = struct.unpack('%df' % (self.vlen,), msg.to_string())
+ self.data = struct.unpack(b'%df' % self.vlen, six.b(msg.to_string()))
+
class test_bin_statistics(gr_unittest.TestCase):