mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Fix for bug in IrcMsg.__eq__.
This commit is contained in:
parent
864fd97315
commit
3f9c699ea2
@ -179,7 +179,8 @@ class IrcMsg(object):
|
||||
return self._len
|
||||
|
||||
def __eq__(self, other):
|
||||
return hash(self) == hash(other) and \
|
||||
return isinstance(other, self.__class__) and \
|
||||
hash(self) == hash(other) and \
|
||||
self.command == other.command and \
|
||||
self.prefix == other.prefix and \
|
||||
self.args == other.args
|
||||
|
@ -59,6 +59,7 @@ class IrcMsgTestCase(SupyTestCase):
|
||||
def testEq(self):
|
||||
for msg in msgs:
|
||||
self.assertEqual(msg, msg)
|
||||
self.failIf(msgs[0] == []) # Comparison to unhashable type.
|
||||
|
||||
def testNe(self):
|
||||
for msg in msgs:
|
||||
|
Loading…
Reference in New Issue
Block a user