Fixed bug in default argument for IrcMsg.__init__ -- args should default to (), not None.

This commit is contained in:
Jeremy Fincher 2003-10-16 13:11:46 +00:00
parent b6185c4b33
commit ee24accaf7
2 changed files with 4 additions and 1 deletions

View File

@ -80,7 +80,7 @@ class IrcMsg(object):
"""
__slots__ = ('args', 'command', 'host', 'nick', 'prefix', 'user',
'_hash', '_str', '_repr', '_len')
def __init__(self, s='', command='', args=None, prefix='', msg=None):
def __init__(self, s='', command='', args=(), prefix='', msg=None):
assert not (msg and s), 'Ircmsg.__init__ cannot accept both s and msg'
if not s and not command and not msg:
raise MalformedIrcMsg, 'IRC messages require a command.'

View File

@ -180,5 +180,8 @@ class FunctionsTestCase(unittest.TestCase):
self.assertEqual(ircmsgs.joins(channels, keys).args,
('#osu,#umich', 'michiganSucks'))
def testQuit(self):
self.failUnless(ircmsgs.quit(prefix='foo!bar@baz'))
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: