From 7717f0d3d4802d115a8b5ace4d379864ba5b1188 Mon Sep 17 00:00:00 2001 From: BonfaceKilz Date: Wed, 26 Aug 2020 18:51:54 +0300 Subject: Replace "__cmp__" with "__eq__" magic method * wqflask/base/GeneralObject.py: "__cmp__" is no longer used in python3. See: --- wqflask/base/GeneralObject.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wqflask/base/GeneralObject.py b/wqflask/base/GeneralObject.py index 707569db..0122ee32 100644 --- a/wqflask/base/GeneralObject.py +++ b/wqflask/base/GeneralObject.py @@ -61,5 +61,6 @@ class GeneralObject: s += '%s = %s\n' % (key, self.__dict__[key]) return s - def __cmp__(self, other): - return len(list(self.__dict__.keys())).__cmp__(len(list(other.__dict__.keys()))) + def __eq__(self, other): + return (len(list(self.__dict__.keys())) == + len(list(other.__dict__.keys()))) -- cgit v1.2.3