remove Python 2/3 import hack

This commit is contained in:
Roman Zeyde
2014-08-28 16:50:01 +03:00
parent 20dbbec7f4
commit 8409940cae
2 changed files with 7 additions and 7 deletions

View File

@@ -102,12 +102,6 @@ def take(iterable, n):
return np.array(list(itertools.islice(iterable, n)))
try:
izip = itertools.izip
except AttributeError:
izip = zip # Python 3
class Dummy(object):
def __getattr__(self, name):

View File

@@ -163,6 +163,12 @@ def train_receiver(sampler, order, lookahead):
stats = {}
def izip(streams):
iters = [iter(s) for s in streams]
while True:
yield [next(i) for i in iters]
def demodulate(sampler, freqs):
streams = []
symbol_list = []
@@ -187,7 +193,7 @@ def demodulate(sampler, freqs):
stats['rx_start'] = time.time()
log.info('Demodulation started')
for i, block in enumerate(common.izip(*streams)): # block per frequency
for i, block in enumerate(izip(streams)): # block per frequency
for bits in block:
stats['rx_bits'] = stats['rx_bits'] + len(bits)
yield bits