From c238d26a9e342ce88527844eca7975ececeb6849 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Wed, 11 Sep 2019 01:40:43 +0200 Subject: [PATCH] Fix "NameError: name 'cmp' is not defined" Source: https://codegolf.stackexchange.com/questions/49778/how-can-i-use-cmpa-b-with-python3 Now the wicd daemon starts as "/usr/sbin/wicd -c -f -e -o" wihout errors, only warnings are left. wicd-curses also runs but spews warnings into the status line, too. --- wicd/networking.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wicd/networking.py b/wicd/networking.py index 87867f0..fb9149d 100644 --- a/wicd/networking.py +++ b/wicd/networking.py @@ -644,7 +644,8 @@ class Wireless(Controller): key = 'quality' else: key = 'strength' - return cmp(x[key], y[key]) + return ((x[key] > y[key]) - (x[key] < y[key])) # cmp(x[key], y[key]) + if not self.wiface: return []