From b678c0dc57d40d47a6b2f16c0b8af1a403bfa1a9 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Sun, 21 Sep 2014 17:11:22 +0300 Subject: [PATCH] recv: fix division by 0 error --- amodem/recv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amodem/recv.py b/amodem/recv.py index 24aa8e4..eb47f01 100644 --- a/amodem/recv.py +++ b/amodem/recv.py @@ -241,7 +241,7 @@ class Receiver(object): audio_time = self.stats['rx_bits'] / float(modem.modem_bps) log.debug('Demodulated %.3f kB @ %.3f seconds (%.1f%% realtime)', self.stats['rx_bits'] / 8e3, duration, - 100 * duration / audio_time) + 100 * duration / audio_time if audio_time else 0) log.info('Received %.3f kB @ %.3f seconds = %.3f kB/s', self.size * 1e-3, duration, self.size * 1e-3 / duration)