From c2789eb46700e9c5b4c7a17d4cd7f80cd37e712f Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Wed, 11 Sep 2019 01:29:07 +0200 Subject: [PATCH] Fix "TypeError: sorted expected 1 arguments, got 2" --- wicd/wnettools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wicd/wnettools.py b/wicd/wnettools.py index bfa290b..cb9d125 100644 --- a/wicd/wnettools.py +++ b/wicd/wnettools.py @@ -38,6 +38,7 @@ import time import dbus import socket, fcntl import shutil +from functools import cmp_to_key from . import wpath from . import misc @@ -1444,7 +1445,7 @@ class BaseWirelessInterface(BaseInterface): m = re.findall(bitrates_pattern, bitrates) if m: # numeric sort - ap['bitrates'] = sorted(m, lambda x, y: int(float(x) - float(y))) + ap['bitrates'] = sorted(m, key=cmp_to_key(lambda x, y: int(float(x) - float(y)))) else: ap['bitrates'] = None