From 8913abdf9a05d2fe3397a28d08f5f16394e70f7c Mon Sep 17 00:00:00 2001 From: bitromortac Date: Wed, 22 Sep 2021 10:59:33 +0200 Subject: [PATCH] python3.9: sample from list instead of set electrum/electrum/channel_db.py:357: DeprecationWarning: Sampling from a set deprecated since Python 3.9 and will be removed in a subsequent version. --- electrum/channel_db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electrum/channel_db.py b/electrum/channel_db.py index 8eeee39a6..33ca2020a 100644 --- a/electrum/channel_db.py +++ b/electrum/channel_db.py @@ -354,7 +354,7 @@ class ChannelDB(SqlDB): def get_200_randomly_sorted_nodes_not_in(self, node_ids): with self.lock: unshuffled = set(self._nodes.keys()) - node_ids - return random.sample(unshuffled, min(200, len(unshuffled))) + return random.sample(list(unshuffled), min(200, len(unshuffled))) def get_last_good_address(self, node_id: bytes) -> Optional[LNPeerAddr]: """Returns latest address we successfully connected to, for given node."""