diff options
| author | 2018-11-04 17:23:34 +0000 | |
|---|---|---|
| committer | 2018-11-04 17:23:34 +0000 | |
| commit | c1e9825a3384a8bcde618b29b8f90b57a8d266cf (patch) | |
| tree | b9b369ab24b63ffeaf751a54a8b0938e99531af4 | |
| parent | Implement utils.irc.IRCArgs.__len__ (diff) | |
| signature | ||
Don't set `args` to a split of the data left over when parsing out a command if
there's not a space after the command
| -rw-r--r-- | src/utils/irc.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/utils/irc.py b/src/utils/irc.py index da9a0747..8aa27289 100644 --- a/src/utils/irc.py +++ b/src/utils/irc.py @@ -92,9 +92,12 @@ def parse_line(line: str) -> IRCLine: if line[0] == ":": prefix_str, line = line[1:].split(" ", 1) prefix = seperate_hostmask(prefix_str) - command, _, line = line.partition(" ") - args = line.split(" ") + args = [] + command, sep, line = line.partition(" ") + if sep: + args = line.split(" ") + if arbitrary: args.append(arbitrary) |
