diff options
author | Florent Le Coz <louiz@louiz.org> | 2012-05-20 13:43:53 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2012-05-20 13:43:53 +0200 |
commit | 65c2d3dc8891eae4307375eef4b79d13ac793e46 (patch) | |
tree | 98359af6c6d9809585b52dcc1aadf083fa590412 /src/xhtml.py | |
parent | 0f0efb7ada6ad60f88360bc6a8feb3607fcabd3c (diff) | |
parent | 51c788ad96703d215942499ffefe6fdc98326b6b (diff) | |
download | poezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.tar.gz poezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.tar.bz2 poezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.tar.xz poezio-65c2d3dc8891eae4307375eef4b79d13ac793e46.zip |
Merge branch 'master' of https://git.louiz.org/poezio
Diffstat (limited to 'src/xhtml.py')
-rw-r--r-- | src/xhtml.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/xhtml.py b/src/xhtml.py index cf7a5fc0..38ec690c 100644 --- a/src/xhtml.py +++ b/src/xhtml.py @@ -206,7 +206,10 @@ def ncurses_color_to_html(color): html color. """ if color <= 15: - (r, g, b) = curses.color_content(color) + try: + (r, g, b) = curses.color_content(color) + except: # fallback in faulty terminals (e.g. xterm) + (r, g, b) = curses.color_content(color%8) r = r / 1000 * 6 - 0.01 g = g / 1000 * 6 - 0.01 b = b / 1000 * 6 - 0.01 |