From d6059ac71ee56f7ee90178c5b4e229b954500df7 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Sat, 5 Apr 2003 10:28:30 +0000 Subject: [PATCH] Added proper ValueError raising when there's no command in IrcMsg.__init__. --- src/ircmsgs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ircmsgs.py b/src/ircmsgs.py index 91ae8f2e0..8d507f887 100644 --- a/src/ircmsgs.py +++ b/src/ircmsgs.py @@ -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