diff options
author | Omar Ghishan <omar.ghishan@rd.io> | 2013-12-18 17:54:17 -0800 |
---|---|---|
committer | Omar Ghishan <omar.ghishan@rd.io> | 2014-01-06 15:14:50 -0800 |
commit | 4d6bafae7ece327ccccc8f2e42ffef1eed061096 (patch) | |
tree | 4f1cada8bf53114f1571e89a01063509c5f9c2ea /kafka/consumer.py | |
parent | 8c8ca5fa573c21e0f03c892154ba42e187153600 (diff) | |
download | kafka-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.py | 8 |
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""" |