Browse Source

[Contribs] Fix parsing bug in errcode.py

Make sure parser doesn't choke on line with space at end.
tags/v0.9.4
Stefan Hajnoczi 16 years ago
parent
commit
711a59cf03
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      contrib/errcode/gpxebot.py

+ 4
- 1
contrib/errcode/gpxebot.py View File

@@ -88,7 +88,10 @@ def parse(line):
88 88
         who = None
89 89
     args = []
90 90
     while line and line[0] != ':' and line.find(' ') != -1:
91
-        arg, line = line.split(None, 1)
91
+        fields = line.split(None, 1)
92
+        if len(fields) == 1:
93
+            fields.append(None)
94
+        arg, line = fields
92 95
         args.append(arg)
93 96
     if line:
94 97
         if line[0] == ':':

Loading…
Cancel
Save