This code was for old versions of bitbake which we're now long past. Drop it
and simplify the code.

Signed-off-by: Richard Purdie <richard.pur...@linuxfoundation.org>
---
 meta/classes/base.bbclass | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index e51722d945d..3515720bf95 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -23,18 +23,11 @@ def oe_import(d):
     bbpath = [os.path.join(dir, "lib") for dir in 
d.getVar("BBPATH").split(":")]
     sys.path[0:0] = [dir for dir in bbpath if dir not in sys.path]
 
-    def inject(name, value):
-        """Make a python object accessible from the metadata"""
-        if hasattr(bb.utils, "_context"):
-            bb.utils._context[name] = value
-        else:
-            __builtins__[name] = value
-
     import oe.data
     for toimport in oe.data.typed_value("OE_IMPORTS", d):
         try:
-            imported = __import__(toimport)
-            inject(toimport.split(".", 1)[0], imported)
+            # Make a python object accessible from the metadata
+            bb.utils._context[toimport.split(".", 1)[0]] = __import__(toimport)
         except AttributeError as e:
             bb.error("Error importing OE modules: %s" % str(e))
     return ""
-- 
2.32.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#163809): 
https://lists.openembedded.org/g/openembedded-core/message/163809
Mute This Topic: https://lists.openembedded.org/mt/90152117/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to