ui: Improve error message if bitbake cannot import python curses module
PATCH 1/1 ui: Improve error message if bitbake cannot import python curses module
From: Konrad Scherer <[email protected]>
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.)
Reword commit message, rebase to latest bitbake.
--- lib/bb/ui/knotty.py | 6 +++++- lib/bb/ui/ncurses.py | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-)
lib/bb/ui/knotty.py +5 -1
@@ -141,7 +141,11 @@ class TerminalFilter(object): if not self.interactive: return - import curses + try: + import curses + except ImportError: + sys.exit("FATAL: The knotty ui could not load the required curses python module.") + import termios self.curses = curses self.termios = termios
lib/bb/ui/ncurses.py +7 -1
@@ -47,7 +47,13 @@ from __future__ import division import logging -import os, sys, curses, itertools, time, subprocess +import os, sys, itertools, time, subprocess + +try: + import curses +except ImportError: + sys.exit("FATAL: The ncurses ui could not load the required curses python module.") + import bb import xmlrpclib from bb import ui
Signature · 1 line
1.7.3.4
Quoted 10 lines · Mark Hatle
From: Konrad Scherer <[email protected]>
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.)
Signed-off-by Konrad Scherer <[email protected]>Signed-off-by Jeff Polk <[email protected]>
Quoted 7 lines
Reword commit message, rebase to latest bitbake.
Signed-off-by Mark Hatle <[email protected]>--- lib/bb/ui/knotty.py | 6 +++++- lib/bb/ui/ncurses.py | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-)
Thanks, merged to master.
I did wonder if this shouldn't just print a warning and proceed as if the terminal were non-interactive though. Regardless, this improves the situation.
Cheers,
Richard