Skip to content

Commit 14a9e13

Browse files
committed
fetcher py2 fix: no deque.copy()
1 parent 539c33e commit 14a9e13

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kafka/consumer/fetcher.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@ 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 self._completed_fetches.copy()}
616+
# TODO: switch to deque.copy() with py3
617+
discard = {fetch.topic_partition for fetch in copy.copy(self._completed_fetches)}
617618
current = self._next_partition_records
618619
if current:
619620
discard.add(current.topic_partition)

0 commit comments

Comments
 (0)