avoid a crash on invalid colors
This commit is contained in:
parent
cd16403cb4
commit
15780364cf
1 changed files with 2 additions and 1 deletions
|
@ -138,7 +138,8 @@ 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)))
|
||||
if color_str:
|
||||
self._win.attron(to_curses_attr((int(color_str), -1)))
|
||||
text = text[next_attr_char+len(color_str)+2:]
|
||||
else:
|
||||
text = text[next_attr_char+2:]
|
||||
|
|
Loading…
Reference in a new issue