From 9587c52c8854d31053910cf6e63744fc35c64136 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Wed, 11 Sep 2019 01:33:03 +0200 Subject: [PATCH] Fix "TypeError: cmp is an invalid keyword argument for sort()" --- wicd/networking.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wicd/networking.py b/wicd/networking.py index 97edc8b..87867f0 100644 --- a/wicd/networking.py +++ b/wicd/networking.py @@ -48,6 +48,7 @@ class WiredConnectThread() -- Connection thread for wired import threading import os from signal import SIGTERM +from functools import cmp_to_key # wicd imports from . import misc @@ -663,7 +664,7 @@ def comp(x, y): time.sleep(1) aps = wiface.GetNetworks(essid) - aps.sort(cmp=comp, reverse=True) + aps.sort(key=cmp_to_key(comp), reverse=True) return aps