diff --git a/kivy/weakmethod.py b/kivy/weakmethod.py index b563557f4..4638abf87 100644 --- a/kivy/weakmethod.py +++ b/kivy/weakmethod.py @@ -55,6 +55,15 @@ if sys.version > '3': ''' return self.proxy is not None and not bool(dir(self.proxy)) + def __eq__(self, other): + try: + if type(self) is not type(other): + return False + s = self() + return s is not None and s == other() + except: + return False + def __repr__(self): return ''.format( self.proxy, self.method, self.method_name) @@ -107,7 +116,10 @@ else: def __eq__(self, other): try: - return type(self) is type(other) and self() == other() + if type(self) is not type(other): + return False + s = self() + return s is not None and s == other() except: return False