diff options
author | Douglas Anderson <danderson@ntia.doc.gov> | 2017-02-12 15:52:19 -0800 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2017-02-26 18:21:22 -0800 |
commit | 9e625c4821f4c63421b3d3747c0c4f358fef6c5f (patch) | |
tree | 41dedbe053417be7314cdce15d64fbbb89db4d8d /gnuradio-runtime/python/gnuradio/gru/seq_with_cursor.py | |
parent | e5aabcc6a4a9335f3ef8abf5f89104b626e9364d (diff) |
python3: update non-GRC components to use python2 or python3
Diffstat (limited to 'gnuradio-runtime/python/gnuradio/gru/seq_with_cursor.py')
-rw-r--r-- | gnuradio-runtime/python/gnuradio/gru/seq_with_cursor.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gnuradio-runtime/python/gnuradio/gru/seq_with_cursor.py b/gnuradio-runtime/python/gnuradio/gru/seq_with_cursor.py index def3299b69..0aefbf83bb 100644 --- a/gnuradio-runtime/python/gnuradio/gru/seq_with_cursor.py +++ b/gnuradio-runtime/python/gnuradio/gru/seq_with_cursor.py @@ -21,8 +21,12 @@ # misc utilities +from __future__ import absolute_import +from __future__ import division +from __future__ import unicode_literals + import types -import exceptions + class seq_with_cursor (object): __slots__ = [ 'items', 'index' ] @@ -40,7 +44,7 @@ class seq_with_cursor (object): elif initial_index >= 0 and initial_index < len (self.items): self.index = initial_index else: - raise exceptions.ValueError + raise ValueError def set_index_by_value(self, v): """ @@ -51,9 +55,9 @@ class seq_with_cursor (object): cv = self.current() more = True while cv < v and more: - cv, more = self.next() # side effect! + cv, more = next(self) # side effect! - def next (self): + def __next__ (self): new_index = self.index + 1 if new_index < len (self.items): self.index = new_index @@ -74,4 +78,3 @@ class seq_with_cursor (object): def get_seq (self): return self.items[:] # copy of items - |