Skip to content

Commit 0d627a4

Browse files
committed
Allow None timeout in FetchContext even if block is False
1 parent 3cc4e46 commit 0d627a4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

kafka/consumer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def __init__(self, consumer, block, timeout):
3333
self.consumer = consumer
3434
self.block = block
3535

36-
if block and not timeout:
37-
timeout = FETCH_DEFAULT_BLOCK_TIMEOUT
38-
39-
self.timeout = timeout * 1000
36+
if block:
37+
if not timeout:
38+
timeout = FETCH_DEFAULT_BLOCK_TIMEOUT
39+
self.timeout = timeout * 1000
4040

4141
def __enter__(self):
4242
"""Set fetch values based on blocking status"""

0 commit comments

Comments
 (0)