Skip to content

Commit

Permalink
Iterate over list of comms (#3959)
Browse files Browse the repository at this point in the history
Previously this list could change during iteration
  • Loading branch information
mrocklin authored Jul 21, 2020
1 parent 1dba162 commit 6eab3ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion distributed/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ def close(self):
break
else:
yield asyncio.sleep(0.05)
yield [comm.close() for comm in self._comms] # then forcefully close
yield [comm.close() for comm in list(self._comms)] # then forcefully close
for cb in self._ongoing_coroutines:
cb.cancel()
for i in range(10):
Expand Down

0 comments on commit 6eab3ce

Please sign in to comment.