summaryrefslogtreecommitdiff
path: root/kafka/consumer.py
diff options
context:
space:
mode:
Diffstat (limited to 'kafka/consumer.py')
-rw-r--r--kafka/consumer.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/kafka/consumer.py b/kafka/consumer.py
index f2898ad..57b5b97 100644
--- a/kafka/consumer.py
+++ b/kafka/consumer.py
@@ -294,7 +294,8 @@ class SimpleConsumer(Consumer):
iterator = self.__iter__()
# HACK: This splits the timeout between available partitions
- timeout = timeout * 1.0 / len(self.offsets)
+ if timeout:
+ timeout = timeout * 1.0 / len(self.offsets)
with FetchContext(self, block, timeout):
while count > 0: