Commit 7fad6270 authored by Stefan Behnel's avatar Stefan Behnel

correct asymmetric equality test of UtilityCode objects as it must not depend on the argument order

parent ab2103e9
...@@ -361,7 +361,8 @@ class UtilityCode(UtilityCodeBase): ...@@ -361,7 +361,8 @@ class UtilityCode(UtilityCodeBase):
def __eq__(self, other): def __eq__(self, other):
if self is other: if self is other:
return True return True
if not isinstance(other, type(self)): self_type, other_type = type(self), type(other)
if self_type is not other_type and not (isinstance(other, self_type) or isinstance(self, other_type)):
return False return False
self_proto = getattr(self, 'proto', None) self_proto = getattr(self, 'proto', None)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment