Skip to content

Commit 1847314

Browse files
committed
use copy()
1 parent 5969c14 commit 1847314

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kafka/consumer/fetcher.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ def _fetchable_partitions(self):
613613
fetchable = self._subscriptions.fetchable_partitions()
614614
# do not fetch a partition if we have a pending fetch response to process
615615
# use copy.copy to avoid runtimeerror on mutation from different thread
616-
discard = {fetch.topic_partition for fetch in copy.copy(self._completed_fetches)}
616+
discard = {fetch.topic_partition for fetch in self._completed_fetches.copy()}
617617
current = self._next_partition_records
618618
if current:
619619
discard.add(current.topic_partition)

0 commit comments

Comments
 (0)