From 8d26368433dffb65ff8d144203fc59d8162974fe Mon Sep 17 00:00:00 2001 From: Zack Dever Date: Thu, 12 Dec 2013 17:03:35 -0800 Subject: [PATCH] allow for timeout to be None in SimpleConsumer.get_messages --- kafka/consumer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: