summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-10-02 14:59:18 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-10-02 20:22:02 +0100
commit5b01726d1cf478aba8d1acc73e29f6cab0c9371e (patch)
tree99e90ffc3fd3c2eb5ce32f599230820733cf24e4
parent7eae2502936aa36401491cd1e0e5975db96529ae (diff)
downloadopenembedded-core-contrib-5b01726d1cf478aba8d1acc73e29f6cab0c9371e.tar.gz
openembedded-core-contrib-5b01726d1cf478aba8d1acc73e29f6cab0c9371e.tar.bz2
openembedded-core-contrib-5b01726d1cf478aba8d1acc73e29f6cab0c9371e.zip
base: Improve module import error message
Turn: ERROR: Unable to parse Var <OE_IMPORTED[:=]> Traceback (most recent call last): File "Var <OE_IMPORTED[:=]>", line 1, in <module> File "/media/build1/poky/meta/classes/base.bbclass", line 35, in oe_import(d=<bb.data_smart.DataSmart object at 0x7f1d941ad208>): for toimport in oe.data.typed_value("OE_IMPORTS", d): > imported = __import__(toimport) inject(toimport.split(".", 1)[0], imported) File "/media/build1/poky/meta/lib/oe/sstatesig.py", line 267, in <module>: >class SignatureGeneratorOEEquivHash(SignatureGeneratorOEBasicHashMixIn, bb.siggen.SignatureGeneratorUniHashMixIn, bb.siggen.SignatureGeneratorBasicHash): name = "OEEquivHash" bb.data_smart.ExpansionError: Failure expanding variable OE_IMPORTED[:=], expression was ${@oe_import(d)} which triggered exception AttributeError: module 'bb.siggen' has no attribute 'SignatureGeneratorUniHashMixIn' into: ERROR: Error importing OE modules: module 'bb.siggen' has no attribute 'SignatureGeneratorUniHashMixIn' which can then trigger a version mismatch error message. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/base.bbclass8
1 files changed, 5 insertions, 3 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 0c8a4b2862..d3184ecf7b 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -32,9 +32,11 @@ def oe_import(d):
import oe.data
for toimport in oe.data.typed_value("OE_IMPORTS", d):
- imported = __import__(toimport)
- inject(toimport.split(".", 1)[0], imported)
-
+ try:
+ imported = __import__(toimport)
+ inject(toimport.split(".", 1)[0], imported)
+ except AttributeError as e:
+ bb.error("Error importing OE modules: %s" % str(e))
return ""
# We need the oe module name space early (before INHERITs get added)