Sfoglia il codice sorgente

[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 anni fa
parent
commit
711a59cf03
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4
    1
      contrib/errcode/gpxebot.py

+ 4
- 1
contrib/errcode/gpxebot.py Vedi 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…
Annulla
Salva