mirror of
https://git.codelinaro.org/clo/tools/repo.git
synced 2025-07-26 13:42:15 +08:00
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:
2
color.py
2
color.py
@ -137,7 +137,7 @@ class Coloring(object):
|
|||||||
if v is None:
|
if v is None:
|
||||||
return _Color(fg, bg, attr)
|
return _Color(fg, bg, attr)
|
||||||
|
|
||||||
v = v.trim().lowercase()
|
v = v.strip().lower()
|
||||||
if v == "reset":
|
if v == "reset":
|
||||||
return RESET
|
return RESET
|
||||||
elif v == '':
|
elif v == '':
|
||||||
|
Reference in New Issue
Block a user