summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cooker.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-02 23:12:42 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-05 11:45:16 +0100
commit16f820a2a82c12184e7ea0734a61c45a22e82530 (patch)
treea771cd8ac14e8e02665244b3aeabe34c0bbf31f1 /bitbake/lib/bb/cooker.py
parent4cb33dae15adb7f88a35a3630368db16923bca7e (diff)
downloadpoky-16f820a2a82c12184e7ea0734a61c45a22e82530.tar.gz
bitbake: cooker/cookerdata: Use BBHandledException, not sys.exit()
Calling sys.exit() in the middle of the code is rather antisocial. We catch this in various places but we shouldn't have to. In all these cases we have already sent events explaining to the user what happened. This means the correct exception is BBHandledException. The recent startup changes have moved the point a lot of this code gets called to inside the UI, with memres it would have always been possible from there anyway. This change makes things much more consistent. (Bitbake rev: 91699f366d24480ff3b19faec78fb9f3181b3e14) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r--bitbake/lib/bb/cooker.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index fc017dd19f..a85e3587fd 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -352,7 +352,7 @@ class BBCooker:
352 self.caches_array.append(getattr(module, cache_name)) 352 self.caches_array.append(getattr(module, cache_name))
353 except ImportError as exc: 353 except ImportError as exc:
354 logger.critical("Unable to import extra RecipeInfo '%s' from '%s': %s" % (cache_name, module_name, exc)) 354 logger.critical("Unable to import extra RecipeInfo '%s' from '%s': %s" % (cache_name, module_name, exc))
355 sys.exit("FATAL: Failed to import extra cache class '%s'." % cache_name) 355 raise bb.BBHandledException()
356 356
357 self.databuilder = bb.cookerdata.CookerDataBuilder(self.configuration, False) 357 self.databuilder = bb.cookerdata.CookerDataBuilder(self.configuration, False)
358 self.databuilder.parseBaseConfiguration() 358 self.databuilder.parseBaseConfiguration()
@@ -1127,7 +1127,7 @@ class BBCooker:
1127 from bb import shell 1127 from bb import shell
1128 except ImportError: 1128 except ImportError:
1129 parselog.exception("Interactive mode not available") 1129 parselog.exception("Interactive mode not available")
1130 sys.exit(1) 1130 raise bb.BBHandledException()
1131 else: 1131 else:
1132 shell.start( self ) 1132 shell.start( self )
1133 1133