summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-01-25 11:41:23 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-01-25 12:23:20 +0000
commitc2a47e0ca12cc9617eaf08e1ea07ab77e14bb28f (patch)
tree1ac22551db6689ccbc454a02cb084935f43b0482
parent822d958e24881211848966dbae8602eadc29ad4b (diff)
downloadpoky-c2a47e0ca12cc9617eaf08e1ea07ab77e14bb28f.tar.gz
poky-c2a47e0ca12cc9617eaf08e1ea07ab77e14bb28f.tar.bz2
poky-c2a47e0ca12cc9617eaf08e1ea07ab77e14bb28f.zip
bitbake: utils: Update to use exec_module() instead of load_module()
This is deprecated in python 3.12 and Fedora 35 is throwing warnings so move to the new functions. (Bitbake rev: aaa7f7af23d5f89fe4a5ed48c57ea3dfca07c79d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 68a18fbcb5959e334cf307d7fa8dc63832edb942) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/utils.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 40b5006fe3..2a150fe9c7 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -16,7 +16,8 @@ import bb.msg
import multiprocessing
import fcntl
import importlib
-from importlib import machinery
+import importlib.machinery
+import importlib.util
import itertools
import subprocess
import glob
@@ -1620,7 +1621,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)