All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] utils: Update to use exec_module() instead of load_module()
@ 2022-01-04 23:11 Richard Purdie
  0 siblings, 0 replies; only message in thread
From: Richard Purdie @ 2022-01-04 23:11 UTC (permalink / raw)
  To: bitbake-devel

This is deprecated in python 3.12 and Fedora 35 is throwing warnings so
move to the new functions.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 lib/bb/utils.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 8006f7bd2d..a288f9bb8c 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -1651,7 +1651,9 @@ def load_plugins(logger, plugins, pluginpath):
         logger.debug('Loading plugin %s' % name)
         spec = importlib.machinery.PathFinder.find_spec(name, path=[pluginpath] )
         if spec:
-            return spec.loader.load_module()
+            mod = importlib.util.module_from_spec(spec)
+            spec.loader.exec_module(mod)
+            return mod
 
     logger.debug('Loading plugins from %s...' % pluginpath)
 
-- 
2.32.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-04 23:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 23:11 [PATCH] utils: Update to use exec_module() instead of load_module() Richard Purdie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.