summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorDavid Khouya <dakhouya@gmail.com>2020-07-01 12:27:40 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-07-06 13:47:45 +0100
commit64f2361c5b88118d9731ecd55faf034e215588d2 (patch)
tree9a97ff45dc91c065dcb78332093f9745515837a8 /bitbake/lib
parent8b6b95106a5d4f1f6d34209ec5c475c900270ecd (diff)
downloadpoky-64f2361c5b88118d9731ecd55faf034e215588d2.tar.gz
bitbake: lib/ui/taskexp: Validate gi import
When running bitbake -g -u taskexp without having gi python module or and invalid gtk version, bitbake fails with a stack trace. In case of import or version error, bitbake should exit with an error message instead of a stack trace. (Bitbake rev: 2a2c507f239b047f34765312df4168030e38b90d) Signed-off-by: David Khouya <dakhouya@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/ui/taskexp.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/bitbake/lib/bb/ui/taskexp.py b/bitbake/lib/bb/ui/taskexp.py
index 8fff244235..336d197deb 100644
--- a/bitbake/lib/bb/ui/taskexp.py
+++ b/bitbake/lib/bb/ui/taskexp.py
@@ -8,9 +8,15 @@
8# 8#
9 9
10import sys 10import sys
11import gi 11
12gi.require_version('Gtk', '3.0') 12try:
13from gi.repository import Gtk, Gdk, GObject 13 import gi
14 gi.require_version('Gtk', '3.0')
15except ValueError:
16 sys.exit("FATAL: Gtk version needs to be 3.0")
17except ImportError:
18 sys.exit("FATAL: Gtk ui could not load the required gi python module")
19
14import threading 20import threading
15from xmlrpc import client 21from xmlrpc import client
16import bb 22import bb