Fix for bug in IrcMsg.__eq__.

This commit is contained in:
Jeremy Fincher 2004-12-03 08:08:07 +00:00
parent 864fd97315
commit 3f9c699ea2
2 changed files with 3 additions and 1 deletions

View File

@ -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

View File

@ -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: