diff options
author | Dana Powers <dana.powers@gmail.com> | 2019-12-29 12:52:51 -0800 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2019-12-29 12:52:51 -0800 |
commit | 65b343de9b30d7c50060d8d3264b3e96bdc7fee0 (patch) | |
tree | 89aad75f8f0d616c2011419ff6fa328df2d1dab9 | |
parent | cb684cc0b44c532467542692116e409ace458b07 (diff) | |
download | kafka-python-65b343de9b30d7c50060d8d3264b3e96bdc7fee0.tar.gz |
StopIteration when consumer closedissue-1219-closed-consumer
-rw-r--r-- | kafka/consumer/group.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kafka/consumer/group.py b/kafka/consumer/group.py index bdf0894..bbdf206 100644 --- a/kafka/consumer/group.py +++ b/kafka/consumer/group.py @@ -1174,6 +1174,8 @@ class KafkaConsumer(six.Iterator): return self def __next__(self): + if self._closed: + raise StopIteration('KafkaConsumer closed') # Now that the heartbeat thread runs in the background # there should be no reason to maintain a separate iterator # but we'll keep it available for a few releases just in case |