Added proper ValueError raising when there's no command in IrcMsg.__init__.

This commit is contained in:
Jeremy Fincher 2003-04-05 10:28:30 +00:00
parent cf8c5c01cf
commit d6059ac71e

View File

@ -45,6 +45,8 @@ class IrcMsg(object):
"""
#__slots__ = ('_args', '_command', '_host', '_nick', '_prefix', '_user')
def __init__(self, s='', command='', args=None, prefix='', msg=None):
if not s and not command and not msg:
raise ValueError, 'IRC messages require a command.'
if msg:
prefix = msg.prefix
command = msg.command