summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-10 13:42:51 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-10 14:41:10 +0100
commitf7c55c8147329670fd5bc55b1ae3f47f25b89bab (patch)
tree377ad65ee6ee27b3586832e523da15a56e48b267
parent950a2ea4c91d6e13d7587104367fa85cc7efe01c (diff)
downloadbitbake-f7c55c8147329670fd5bc55b1ae3f47f25b89bab.tar.gz
BBHandler: Allow earlier exit for classes not found
Rather than relying on later code to error if the class isn't found, exit earlier and more clearly from a code perspective. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/parse/parse_py/BBHandler.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/bb/parse/parse_py/BBHandler.py b/lib/bb/parse/parse_py/BBHandler.py
index 68415735f..532a4e08f 100644
--- a/lib/bb/parse/parse_py/BBHandler.py
+++ b/lib/bb/parse/parse_py/BBHandler.py
@@ -56,6 +56,9 @@ def inherit(files, fn, lineno, d):
if abs_fn:
file = abs_fn
+ if not os.path.exists(file):
+ raise ParseError("Could not inherit file %s" % (file), fn, lineno)
+
if not file in __inherit_cache:
logger.debug("Inheriting %s (from %s:%d)" % (file, fn, lineno))
__inherit_cache.append( file )