Always parse the same number of arguments; empty string != None

This commit is contained in:
nemunaire 2014-09-17 06:59:40 +02:00
parent 1beed6751b
commit a0a1ef8989
2 changed files with 3 additions and 3 deletions

View File

@ -62,7 +62,7 @@ class Message:
def parse_content(self):
"""Parse or reparse the message content"""
# Remove !
if self.text[0] == '!':
if len(self.text) > 1 and self.text[0] == '!':
self.qual = "cmd"
self.text = self.text[1:].strip()

View File

@ -271,11 +271,11 @@ class IRCMessage:
self.cmd = self.decode(p.group("command"))
# Parse params
if p.group("params"):
if p.group("params") is not None:
for param in p.group("params").strip().split(b' '):
self.params.append(param)
if p.group("trailing"):
if p.group("trailing") is not None:
self.params.append(p.group("trailing"))