浏览代码

Fix color parsing to not crash when user defined colors are set

We didn't use the right Python string methods to parse colors.

  $ git config --global color.status.added yellow

managed to cause a stack trace due to undefined methods trim()
and lowercase().  Instead use strip() and lower().

Signed-off-by: Shawn O. Pearce <sop@google.com>
Shawn O. Pearce 17 年之前
父节点
当前提交
a8e98a6962
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      color.py

+ 1 - 1
color.py

@@ -137,7 +137,7 @@ class Coloring(object):
     if v is None:
       return _Color(fg, bg, attr)
 
-    v = v.trim().lowercase()
+    v = v.strip().lower()
     if v == "reset":
       return RESET
     elif v == '':