Skip to content

Commit aeb71aa

Browse files
committed
Fix RuntimeError caused by change dict size during iteration
1 parent 37eef4b commit aeb71aa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cassandra/cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2242,7 +2242,7 @@ def prepare_on_all_hosts(self, query, excluded_host):
22422242
Intended for internal use only.
22432243
"""
22442244
futures = []
2245-
for host in self._pools.keys():
2245+
for host in tuple(self._pools.keys()):
22462246
if host != excluded_host and host.is_up:
22472247
future = ResponseFuture(self, PrepareMessage(query=query), None, self.default_timeout)
22482248

0 commit comments

Comments
 (0)