From 490b6304da3fdbf69981d11b3dd23e6720acd9a6 Mon Sep 17 00:00:00 2001 From: moneromooo Date: Sat, 7 Feb 2015 22:40:28 +0000 Subject: [PATCH] reddit: fix command splitting creating empty tokens --- tipbot/modules/reddit.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tipbot/modules/reddit.py b/tipbot/modules/reddit.py index 206ca33..155071a 100644 --- a/tipbot/modules/reddit.py +++ b/tipbot/modules/reddit.py @@ -127,6 +127,8 @@ class RedditNetwork(Network): exidx=line.find('!') if exidx!=-1 and len(line)>exidx+1 and line[exidx+1] in string.ascii_letters and self.is_acceptable_command_prefix(line[:exidx]): cmd=line[exidx+1:].split(' ') + while '' in cmd: + cmd.remove('') cmd[0] = cmd[0].strip(' \t\n\r') log_info('Found command from %s: %s' % (link.identity(), str(cmd))) if self.on_command: