summaryrefslogtreecommitdiff
path: root/gr-blocks/python/blocks/qa_block_gateway.py
diff options
context:
space:
mode:
Diffstat (limited to 'gr-blocks/python/blocks/qa_block_gateway.py')
-rw-r--r--gr-blocks/python/blocks/qa_block_gateway.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/gr-blocks/python/blocks/qa_block_gateway.py b/gr-blocks/python/blocks/qa_block_gateway.py
index 1e848cff04..d4794179bd 100644
--- a/gr-blocks/python/blocks/qa_block_gateway.py
+++ b/gr-blocks/python/blocks/qa_block_gateway.py
@@ -1,3 +1,5 @@
+from __future__ import division
+
#
# Copyright 2011-2013 Free Software Foundation, Inc.
#
@@ -113,7 +115,7 @@ class tag_source(gr.sync_block):
#put code here to fill the output items...
#make a new tag on the middle element every time work is called
- count = self.nitems_written(0) + num_output_items/2
+ count = self.nitems_written(0) + num_output_items // 2
key = pmt.string_to_symbol("example_key")
value = pmt.string_to_symbol("example_value")
self.add_item_tag(0, count, key, value)
@@ -187,8 +189,8 @@ class vector_to_stream(gr.interp_block):
def work(self, input_items, output_items):
n = 0
- for i in xrange(len(input_items[0])):
- for j in xrange(self.block_size):
+ for i in range(len(input_items[0])):
+ for j in range(self.block_size):
output_items[0][n] = input_items[0][i][j]
n += 1