summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass11
1 files changed, 2 insertions, 9 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index e51722d945..3515720bf9 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -23,18 +23,11 @@ def oe_import(d):
23 bbpath = [os.path.join(dir, "lib") for dir in d.getVar("BBPATH").split(":")] 23 bbpath = [os.path.join(dir, "lib") for dir in d.getVar("BBPATH").split(":")]
24 sys.path[0:0] = [dir for dir in bbpath if dir not in sys.path] 24 sys.path[0:0] = [dir for dir in bbpath if dir not in sys.path]
25 25
26 def inject(name, value):
27 """Make a python object accessible from the metadata"""
28 if hasattr(bb.utils, "_context"):
29 bb.utils._context[name] = value
30 else:
31 __builtins__[name] = value
32
33 import oe.data 26 import oe.data
34 for toimport in oe.data.typed_value("OE_IMPORTS", d): 27 for toimport in oe.data.typed_value("OE_IMPORTS", d):
35 try: 28 try:
36 imported = __import__(toimport) 29 # Make a python object accessible from the metadata
37 inject(toimport.split(".", 1)[0], imported) 30 bb.utils._context[toimport.split(".", 1)[0]] = __import__(toimport)
38 except AttributeError as e: 31 except AttributeError as e:
39 bb.error("Error importing OE modules: %s" % str(e)) 32 bb.error("Error importing OE modules: %s" % str(e))
40 return "" 33 return ""