summaryrefslogtreecommitdiff
path: root/kafka/consumer/fetcher.py
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2018-01-12 12:48:43 -0800
committerGitHub <noreply@github.com>2018-01-12 12:48:43 -0800
commit298709d2590b201dfe1b8753baacd1d2b554710f (patch)
tree31023dc599ed90ce7fc67a0dbb7cd1665a9102b7 /kafka/consumer/fetcher.py
parenta8bf19f88e89bef571b7c1f952010bf405054987 (diff)
downloadkafka-python-298709d2590b201dfe1b8753baacd1d2b554710f.tar.gz
Avoid KeyError when filtering fetchable partitions (#1344)
* Avoid KeyError when filtering fetchable partitions
Diffstat (limited to 'kafka/consumer/fetcher.py')
-rw-r--r--kafka/consumer/fetcher.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/kafka/consumer/fetcher.py b/kafka/consumer/fetcher.py
index debe86b..afb8f52 100644
--- a/kafka/consumer/fetcher.py
+++ b/kafka/consumer/fetcher.py
@@ -638,9 +638,9 @@ class Fetcher(six.Iterator):
def _fetchable_partitions(self):
fetchable = self._subscriptions.fetchable_partitions()
if self._next_partition_records:
- fetchable.remove(self._next_partition_records.topic_partition)
+ fetchable.discard(self._next_partition_records.topic_partition)
for fetch in self._completed_fetches:
- fetchable.remove(fetch.topic_partition)
+ fetchable.discard(fetch.topic_partition)
return fetchable
def _create_fetch_requests(self):