summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kafka/consumer/fetcher.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/kafka/consumer/fetcher.py b/kafka/consumer/fetcher.py
index 0c3b84c..afb8f52 100644
--- a/kafka/consumer/fetcher.py
+++ b/kafka/consumer/fetcher.py
@@ -638,11 +638,9 @@ class Fetcher(six.Iterator):
def _fetchable_partitions(self):
fetchable = self._subscriptions.fetchable_partitions()
if self._next_partition_records:
- if self._next_partition_records.topic_partition in fetchable:
- fetchable.remove(self._next_partition_records.topic_partition)
+ fetchable.discard(self._next_partition_records.topic_partition)
for fetch in self._completed_fetches:
- if fetch.topic_partition in fetchable:
- fetchable.remove(fetch.topic_partition)
+ fetchable.discard(fetch.topic_partition)
return fetchable
def _create_fetch_requests(self):