From 327a539a552f4f48a6627d1f6d7f229b0a5426e8 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Mon, 29 Nov 2021 16:30:33 +0200 Subject: [PATCH] Replace removed cmp parameter of list.sort() by key in getSortedAccounts() --- src/bitmessageqt/account.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/bitmessageqt/account.py b/src/bitmessageqt/account.py index a1331334..852eb836 100644 --- a/src/bitmessageqt/account.py +++ b/src/bitmessageqt/account.py @@ -22,10 +22,8 @@ def getSortedAccounts(): """Get a sorted list of address config sections""" configSections = BMConfigParser().addresses() configSections.sort( - cmp=lambda x, y: cmp( - BMConfigParser().get(x, 'label').decode('utf-8').lower(), - BMConfigParser().get(y, 'label').decode('utf-8').lower()) - ) + key=lambda item: + BMConfigParser().get(item, 'label').decode('utf-8').lower()) return configSections