We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f8a91ec commit 3ee9ef3Copy full SHA for 3ee9ef3
kafka/consumer/fetcher.py
@@ -1,5 +1,4 @@
1
import collections
2
-import copy
3
import itertools
4
import logging
5
import sys
@@ -611,8 +610,7 @@ def _fetchable_partitions(self):
611
610
fetchable = self._subscriptions.fetchable_partitions()
612
# do not fetch a partition if we have a pending fetch response to process
613
# use copy.copy to avoid runtimeerror on mutation from different thread
614
- # TODO: switch to deque.copy() with py3
615
- discard = {fetch.topic_partition for fetch in copy.copy(self._completed_fetches)}
+ discard = {fetch.topic_partition for fetch in self._completed_fetches.copy()}
616
current = self._next_partition_records
617
if current:
618
discard.add(current.topic_partition)
0 commit comments