diff --git a/kafka/consumer.py b/kafka/consumer.py index f2898ad43..57b5b9742 100644 --- a/kafka/consumer.py +++ b/kafka/consumer.py @@ -294,7 +294,8 @@ def get_messages(self, count=1, block=True, timeout=0.1): 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: