瀏覽代碼

[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 年之前
父節點
當前提交
711a59cf03
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4
    1
      contrib/errcode/gpxebot.py

+ 4
- 1
contrib/errcode/gpxebot.py 查看文件

@@ -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…
取消
儲存