utils: Update to use exec_module() instead of load_module()
PATCH 1/1 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.
Signed-off-by Richard Purdie <[email protected]>
--- lib/bb/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
lib/bb/utils.py +3 -1
@@ -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)
Signature · 1 line
2.32.0