diff options
author | Konrad Scherer <Konrad.Scherer@windriver.com> | 2012-08-21 16:05:58 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-08-22 13:59:57 +0100 |
commit | 1a7069e97b9ec208dc3cb70f9465b65de7e0a6f9 (patch) | |
tree | 9695eed79e83ad8e2b33fa1a116a83a3c581fcd8 | |
parent | 1426e14747d08f667bc921c6c3f1cc3187d0de47 (diff) | |
download | poky-1a7069e97b9ec208dc3cb70f9465b65de7e0a6f9.tar.gz |
bitbake: ui: Improve error message if bitbake cannot import python curses module
On some SuSE systems, the curses python module is not installed by default.
Instead of a python failure, we want a nicer error message.
(On SuSE systems the package is typically python-curses.)
(Bitbake rev: 65a5845ac942d0aa6838c295e41b656f9d2a98bb)
Signed-off-by: Konrad Scherer <Konrad.Scherer@windriver.com>
Signed-off-by: Jeff Polk <jeff.polk@windriver.com>
Reword commit message, rebase to latest bitbake.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/ui/knotty.py | 6 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/ncurses.py | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py index b01daee573..858cacfe55 100644 --- a/bitbake/lib/bb/ui/knotty.py +++ b/bitbake/lib/bb/ui/knotty.py | |||
@@ -141,7 +141,11 @@ class TerminalFilter(object): | |||
141 | if not self.interactive: | 141 | if not self.interactive: |
142 | return | 142 | return |
143 | 143 | ||
144 | import curses | 144 | try: |
145 | import curses | ||
146 | except ImportError: | ||
147 | sys.exit("FATAL: The knotty ui could not load the required curses python module.") | ||
148 | |||
145 | import termios | 149 | import termios |
146 | self.curses = curses | 150 | self.curses = curses |
147 | self.termios = termios | 151 | self.termios = termios |
diff --git a/bitbake/lib/bb/ui/ncurses.py b/bitbake/lib/bb/ui/ncurses.py index 1425bbd263..f573b95574 100644 --- a/bitbake/lib/bb/ui/ncurses.py +++ b/bitbake/lib/bb/ui/ncurses.py | |||
@@ -47,7 +47,13 @@ | |||
47 | 47 | ||
48 | from __future__ import division | 48 | from __future__ import division |
49 | import logging | 49 | import logging |
50 | import os, sys, curses, itertools, time, subprocess | 50 | import os, sys, itertools, time, subprocess |
51 | |||
52 | try: | ||
53 | import curses | ||
54 | except ImportError: | ||
55 | sys.exit("FATAL: The ncurses ui could not load the required curses python module.") | ||
56 | |||
51 | import bb | 57 | import bb |
52 | import xmlrpclib | 58 | import xmlrpclib |
53 | from bb import ui | 59 | from bb import ui |