From cbc25057f1b4c9be4dff300817478500c37dc48c Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Thu, 13 Jan 2022 04:10:13 -1000 Subject: 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: e84c9aa77b61e48f1507edcba7bde65295f4d3ad) Signed-off-by: Richard Purdie (cherry picked from commit 68a18fbcb5959e334cf307d7fa8dc63832edb942) Signed-off-by: Steve Sakoman Signed-off-by: Richard Purdie --- bitbake/lib/bb/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 5f5767c1da..fab16ffc58 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 @@ -1584,7 +1585,9 @@ def load_plugins(logger, plugins, pluginpath): logger.debug(1, '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(1, 'Loading plugins from %s...' % pluginpath) -- cgit v1.2.3-54-g00ecf