diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-11-25 21:17:41 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-11-25 21:34:36 +0000 |
commit | 4548a8f037eaf8d47a77052acc3e9ec264ac41e0 (patch) | |
tree | eb9f4f460b6895ab2f0e932ab9126e7651bb7841 /lib/bb/msg.py | |
parent | 0db80d57d4d2b1bb97375444c439827450ff33d1 (diff) | |
download | bitbake-contrib-4548a8f037eaf8d47a77052acc3e9ec264ac41e0.tar.gz |
knotty/msg: Avoid usage of curses initscr/endwin to avoid terminal corruption
Using curses initscr/endwin causes screen corruption if for example you
suspend bitbake and resume it. This changes the code to use a less
invasive approach to determining colour availability on the terminal.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/msg.py')
-rw-r--r-- | lib/bb/msg.py | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/lib/bb/msg.py b/lib/bb/msg.py index 007c95a4e..e70daee92 100644 --- a/lib/bb/msg.py +++ b/lib/bb/msg.py @@ -106,17 +106,7 @@ class BBLogFormatter(logging.Formatter): return record def enable_color(self): - import curses - try: - win = None - win = curses.initscr() - if curses.has_colors(): - self.color_enabled = True - except: - pass - finally: - if win is not None: - curses.endwin() + self.color_enabled = True class BBLogFilter(object): def __init__(self, handler, level, debug_domains): |