summaryrefslogtreecommitdiff
path: root/kafka/consumer.py
diff options
context:
space:
mode:
authorOmar Ghishan <omar.ghishan@rd.io>2013-12-18 17:54:17 -0800
committerOmar Ghishan <omar.ghishan@rd.io>2014-01-06 15:14:50 -0800
commit4d6bafae7ece327ccccc8f2e42ffef1eed061096 (patch)
tree4f1cada8bf53114f1571e89a01063509c5f9c2ea /kafka/consumer.py
parent8c8ca5fa573c21e0f03c892154ba42e187153600 (diff)
downloadkafka-python-4d6bafae7ece327ccccc8f2e42ffef1eed061096.tar.gz
Allow None timeout in FetchContext even if block is False
Diffstat (limited to 'kafka/consumer.py')
-rw-r--r--kafka/consumer.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/kafka/consumer.py b/kafka/consumer.py
index bead1dd..5d2775d 100644
--- a/kafka/consumer.py
+++ b/kafka/consumer.py
@@ -33,10 +33,10 @@ class FetchContext(object):
self.consumer = consumer
self.block = block
- if block and not timeout:
- timeout = FETCH_DEFAULT_BLOCK_TIMEOUT
-
- self.timeout = timeout * 1000
+ if block:
+ if not timeout:
+ timeout = FETCH_DEFAULT_BLOCK_TIMEOUT
+ self.timeout = timeout * 1000
def __enter__(self):
"""Set fetch values based on blocking status"""