Skip to content

Commit 3ee9ef3

Browse files
yranjan06Ranjan Yadav
andauthored
REF: Switch to deque.copy() for Python 3 compatibility (#2712)
Co-authored-by: Ranjan Yadav <ranjanyadav@Ranjans-MacBook-Air.local>
1 parent f8a91ec commit 3ee9ef3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

kafka/consumer/fetcher.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import collections
2-
import copy
32
import itertools
43
import logging
54
import sys
@@ -611,8 +610,7 @@ def _fetchable_partitions(self):
611610
fetchable = self._subscriptions.fetchable_partitions()
612611
# do not fetch a partition if we have a pending fetch response to process
613612
# 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)}
613+
discard = {fetch.topic_partition for fetch in self._completed_fetches.copy()}
616614
current = self._next_partition_records
617615
if current:
618616
discard.add(current.topic_partition)

0 commit comments

Comments
 (0)