aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2013-05-02 23:22:36 +0200
committerhasufell <julian.ospald@googlemail.com>2013-05-09 00:39:22 +0200
commit67f367938ef8f02a1bcc8614197d455a78d07424 (patch)
treee5675b5a46f3d690e9b7d809d854a8b4283f4e40
parentAdd compression support (diff)
downloadelogv-67f367938ef8f02a1bcc8614197d455a78d07424.tar.gz
elogv-67f367938ef8f02a1bcc8614197d455a78d07424.tar.bz2
elogv-67f367938ef8f02a1bcc8614197d455a78d07424.zip
Fix crash with TERM=vt100
-rwxr-xr-xelogv15
1 files changed, 9 insertions, 6 deletions
diff --git a/elogv b/elogv
index 0ee01bc..2cdc086 100755
--- a/elogv
+++ b/elogv
@@ -104,12 +104,15 @@ class ElogViewer:
self.screen = screen
# Our color pairs
- curses.use_default_colors()
- curses.init_pair(selected, curses.COLOR_BLACK, curses.COLOR_WHITE)
- curses.init_pair(einfo, curses.COLOR_GREEN, curses.COLOR_BLACK)
- curses.init_pair(ewarn, curses.COLOR_YELLOW, curses.COLOR_BLACK)
- curses.init_pair(eerror, curses.COLOR_RED, curses.COLOR_BLACK)
- curses.init_pair(elog, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
+ try:
+ curses.use_default_colors()
+ curses.init_pair(selected, curses.COLOR_BLACK, curses.COLOR_WHITE)
+ curses.init_pair(einfo, curses.COLOR_GREEN, curses.COLOR_BLACK)
+ curses.init_pair(ewarn, curses.COLOR_YELLOW, curses.COLOR_BLACK)
+ curses.init_pair(eerror, curses.COLOR_RED, curses.COLOR_BLACK)
+ curses.init_pair(elog, curses.COLOR_MAGENTA, curses.COLOR_BLACK)
+ except curses.error: # e.g. with "TERM=vt100 elogv" invokation
+ pass
# This attributes are used to manage the scrolling of the list
# of files