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>
This commit is contained in:
Shawn O. Pearce 2009-02-02 16:17:02 -08:00
parent b54a392c9a
commit a8e98a6962

View File

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