From a8e98a6962727969da9faa12658596c8b1a14baf Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Mon, 2 Feb 2009 16:17:02 -0800 Subject: [PATCH] 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 --- color.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/color.py b/color.py index b3a558cd..07d1f6fd 100644 --- a/color.py +++ b/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 == '':