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/eng_notation.py | |
parent | e5aabcc6a4a9335f3ef8abf5f89104b626e9364d (diff) |
python3: update non-GRC components to use python2 or python3
Diffstat (limited to 'gnuradio-runtime/python/gnuradio/eng_notation.py')
-rw-r--r-- | gnuradio-runtime/python/gnuradio/eng_notation.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gnuradio-runtime/python/gnuradio/eng_notation.py b/gnuradio-runtime/python/gnuradio/eng_notation.py index d23f9005f0..5a3a216ee4 100644 --- a/gnuradio-runtime/python/gnuradio/eng_notation.py +++ b/gnuradio-runtime/python/gnuradio/eng_notation.py @@ -21,6 +21,7 @@ """ Display numbers as strings using engineering notation. """ +from __future__ import unicode_literals scale_factor = {} scale_factor['E'] = 1e18 @@ -66,7 +67,7 @@ def str_to_num (value): try: scale = 1.0 suffix = value[-1] - if scale_factor.has_key (suffix): + if suffix in scale_factor: return float (value[0:-1]) * scale_factor[suffix] return float (value) except: |