Replace removed cmp parameter of list.sort() by key in getSortedAccounts()

This commit is contained in:
Dmitri Bogomolov 2021-11-29 16:30:33 +02:00
parent ced7b4df30
commit 327a539a55
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -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