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
         who = None
88
         who = None
89
     args = []
89
     args = []
90
     while line and line[0] != ':' and line.find(' ') != -1:
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
         args.append(arg)
95
         args.append(arg)
93
     if line:
96
     if line:
94
         if line[0] == ':':
97
         if line[0] == ':':

Loading…
Cancel
Save