summaryrefslogtreecommitdiff
path: root/src/windows.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-09-25 15:31:12 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-09-25 15:31:12 +0200
commitb5ce85869b12c1a0c8a9cf781f3d1dd989443355 (patch)
tree7238f999a5ee246f49ca73b688035f5253de6cbd /src/windows.py
parent5ac6b7f8dc65f3e6e8f559c2b2ed08998d025f19 (diff)
downloadpoezio-b5ce85869b12c1a0c8a9cf781f3d1dd989443355.tar.gz
poezio-b5ce85869b12c1a0c8a9cf781f3d1dd989443355.tar.bz2
poezio-b5ce85869b12c1a0c8a9cf781f3d1dd989443355.tar.xz
poezio-b5ce85869b12c1a0c8a9cf781f3d1dd989443355.zip
Forgot that…
Diffstat (limited to 'src/windows.py')
-rw-r--r--src/windows.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/windows.py b/src/windows.py
index 2352a82a..1bfe49db 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -137,8 +137,13 @@ class Win(object):
self._win.attron(curses.A_BOLD)
if attr_char in string.digits and attr_char != '':
color_str = text[next_attr_char+1:text.find('}', next_attr_char)]
- self._win.attron(to_curses_attr((int(color_str), -1)))
- text = text[next_attr_char+len(color_str)+2:]
+ try:
+ self._win.attron(to_curses_attr((int(color_str), -1)))
+ except:
+ self._win.attron(to_curses_attr((-1, -1)))
+ text = text[next_attr_char+1+2:]
+ else:
+ text = text[next_attr_char+len(color_str)+2:]
else:
text = text[next_attr_char+2:]
next_attr_char = text.find('\x19')