From ac2f7e546df3b7f4a936cdb4d558adc517c5ddb4 Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Wed, 5 Nov 2014 16:40:27 -0800 Subject: [PATCH] Adjust syntax for old Python 2 --- tb/test_axis_stat_counter.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tb/test_axis_stat_counter.py b/tb/test_axis_stat_counter.py index 670f2145a..c455b7990 100755 --- a/tb/test_axis_stat_counter.py +++ b/tb/test_axis_stat_counter.py @@ -226,7 +226,7 @@ def bench(): if not sink_queue.empty(): rx_frame = sink_queue.get() - rx_frame_values = struct.unpack(">HLLL", rx_frame.data) + rx_frame_values = struct.unpack(">HLLL", bytes(rx_frame.data)) cycles = (stop_time - start_time) / 8 print(rx_frame_values) @@ -273,7 +273,7 @@ def bench(): if not sink_queue.empty(): rx_frame = sink_queue.get() - rx_frame_values = struct.unpack(">HLLL", rx_frame.data) + rx_frame_values = struct.unpack(">HLLL", bytes(rx_frame.data)) cycles = (stop_time - start_time) / 8 print(rx_frame_values) @@ -326,7 +326,7 @@ def bench(): if not sink_queue.empty(): rx_frame = sink_queue.get() - rx_frame_values = struct.unpack(">HLLL", rx_frame.data) + rx_frame_values = struct.unpack(">HLLL", bytes(rx_frame.data)) cycles = (stop_time - start_time) / 8 print(rx_frame_values) @@ -380,7 +380,7 @@ def bench(): if not sink_queue.empty(): rx_frame = sink_queue.get() - rx_frame_values = struct.unpack(">HLLL", rx_frame.data) + rx_frame_values = struct.unpack(">HLLL", bytes(rx_frame.data)) cycles = (stop_time - start_time) / 8 print(rx_frame_values) @@ -448,7 +448,7 @@ def bench(): if not sink_queue.empty(): rx_frame = sink_queue.get() - rx_frame_values = struct.unpack(">HLLL", rx_frame.data) + rx_frame_values = struct.unpack(">HLLL", bytes(rx_frame.data)) cycles = (stop_time - start_time) / 8 print(rx_frame_values) @@ -507,7 +507,7 @@ def bench(): if not sink_queue.empty(): rx_frame = sink_queue.get() - rx_frame_values = struct.unpack(">HLLL", rx_frame.data) + rx_frame_values = struct.unpack(">HLLL", bytes(rx_frame.data)) cycles = (stop_time - start_time) / 8 print(rx_frame_values) @@ -566,7 +566,7 @@ def bench(): if not sink_queue.empty(): rx_frame = sink_queue.get() - rx_frame_values = struct.unpack(">HLLL", rx_frame.data) + rx_frame_values = struct.unpack(">HLLL", bytes(rx_frame.data)) cycles = (stop_time - start_time) / 8 print(rx_frame_values) @@ -625,7 +625,7 @@ def bench(): if not sink_queue.empty(): rx_frame = sink_queue.get() - rx_frame_values = struct.unpack(">HLLL", rx_frame.data) + rx_frame_values = struct.unpack(">HLLL", bytes(rx_frame.data)) cycles = (stop_time - start_time) / 8 print(rx_frame_values) @@ -685,7 +685,7 @@ def bench(): if not sink_queue.empty(): rx_frame = sink_queue.get() - rx_frame_values = struct.unpack(">HLLL", rx_frame.data) + rx_frame_values = struct.unpack(">HLLL", bytes(rx_frame.data)) cycles = (stop_time - start_time) / 8 print(rx_frame_values) @@ -758,12 +758,12 @@ def bench(): if not sink_queue.empty(): rx_frame2 = sink_queue.get() - rx_frame_values = struct.unpack(">HLLL", rx_frame.data) + rx_frame_values = struct.unpack(">HLLL", bytes(rx_frame.data)) cycles = (stop_time - start_time) / 8 cycles1 = (trigger_time - start_time) / 8 print(rx_frame_values) - rx_frame2_values = struct.unpack(">HLLL", rx_frame2.data) + rx_frame2_values = struct.unpack(">HLLL", bytes(rx_frame2.data)) cycles2 = (stop_time - trigger_time) / 8 print(rx_frame2_values)