summaryrefslogtreecommitdiffstats
path: root/color.py
diff options
context:
space:
mode:
authorShawn O. Pearce <sop@google.com>2009-02-02 16:17:02 -0800
committerShawn O. Pearce <sop@google.com>2009-02-02 16:17:02 -0800
commita8e98a6962727969da9faa12658596c8b1a14baf (patch)
tree4666a12620fdc276f619714a88fc32d73bd49919 /color.py
parentb54a392c9a267a06058b663377282c9dcec6878e (diff)
downloadgit-repo-a8e98a6962727969da9faa12658596c8b1a14baf.tar.gz
Fix color parsing to not crash when user defined colors are setv1.5.1
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>
Diffstat (limited to 'color.py')
-rw-r--r--color.py2
1 files changed, 1 insertions, 1 deletions
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):
137 if v is None: 137 if v is None:
138 return _Color(fg, bg, attr) 138 return _Color(fg, bg, attr)
139 139
140 v = v.trim().lowercase() 140 v = v.strip().lower()
141 if v == "reset": 141 if v == "reset":
142 return RESET 142 return RESET
143 elif v == '': 143 elif v == '':