diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-10-09 17:39:20 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-12-02 14:37:53 +0000 |
commit | b409a428c1e8c7d91b039682355fee8145d31a4f (patch) | |
tree | 5712586086942aab7783266e5e82e16bc24b6ec9 /bitbake | |
parent | 0839888394a6e42e96f9f0d201376eb38bc79b24 (diff) | |
download | poky-b409a428c1e8c7d91b039682355fee8145d31a4f.tar.gz |
bitbake: command: Ensure exceptions inheriting from BBHandledException are visible
Previous changes allowed BBHandledException to be detected but not exceptions
which inherit from it. Fix this. The code really needs totally reworking
to preserve the exceptions.
[YOCTO #14054]
(Bitbake rev: 80348b68a34b7ec45a0496a4af7f2ae0c26488f0)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit ef762d92df6c2554c6248e80212f984d9ec4c651)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/command.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index 6abf38668b..07128027fd 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py | |||
@@ -74,8 +74,12 @@ class Command: | |||
74 | result = command_method(self, commandline) | 74 | result = command_method(self, commandline) |
75 | except CommandError as exc: | 75 | except CommandError as exc: |
76 | return None, exc.args[0] | 76 | return None, exc.args[0] |
77 | except (Exception, SystemExit): | 77 | except (Exception, SystemExit) as exc: |
78 | import traceback | 78 | import traceback |
79 | if isinstance(exc, bb.BBHandledException): | ||
80 | # We need to start returning real exceptions here. Until we do, we can't | ||
81 | # tell if an exception is an instance of bb.BBHandledException | ||
82 | return None, "bb.BBHandledException()\n" + traceback.format_exc() | ||
79 | return None, traceback.format_exc() | 83 | return None, traceback.format_exc() |
80 | else: | 84 | else: |
81 | return result, None | 85 | return result, None |