Bläddra i källkod

[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 år sedan
förälder
incheckning
711a59cf03
1 ändrade filer med 4 tillägg och 1 borttagningar
  1. 4
    1
      contrib/errcode/gpxebot.py

+ 4
- 1
contrib/errcode/gpxebot.py Visa fil

@@ -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] == ':':

Laddar…
Avbryt
Spara