diff options
author | David Khouya <dakhouya@gmail.com> | 2020-07-01 12:27:40 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-07-06 13:47:45 +0100 |
commit | 64f2361c5b88118d9731ecd55faf034e215588d2 (patch) | |
tree | 9a97ff45dc91c065dcb78332093f9745515837a8 | |
parent | 8b6b95106a5d4f1f6d34209ec5c475c900270ecd (diff) | |
download | poky-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>
-rw-r--r-- | bitbake/lib/bb/ui/taskexp.py | 12 |
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 | ||
10 | import sys | 10 | import sys |
11 | import gi | 11 | |
12 | gi.require_version('Gtk', '3.0') | 12 | try: |
13 | from gi.repository import Gtk, Gdk, GObject | 13 | import gi |
14 | gi.require_version('Gtk', '3.0') | ||
15 | except ValueError: | ||
16 | sys.exit("FATAL: Gtk version needs to be 3.0") | ||
17 | except ImportError: | ||
18 | sys.exit("FATAL: Gtk ui could not load the required gi python module") | ||
19 | |||
14 | import threading | 20 | import threading |
15 | from xmlrpc import client | 21 | from xmlrpc import client |
16 | import bb | 22 | import bb |