mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 17:39:31 +00:00
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: 68a18fbcb5959e334cf307d7fa8dc63832edb942) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -16,7 +16,8 @@ import bb.msg
|
|||||||
import multiprocessing
|
import multiprocessing
|
||||||
import fcntl
|
import fcntl
|
||||||
import importlib
|
import importlib
|
||||||
from importlib import machinery
|
import importlib.machinery
|
||||||
|
import importlib.util
|
||||||
import itertools
|
import itertools
|
||||||
import subprocess
|
import subprocess
|
||||||
import glob
|
import glob
|
||||||
@@ -1620,7 +1621,9 @@ def load_plugins(logger, plugins, pluginpath):
|
|||||||
logger.debug('Loading plugin %s' % name)
|
logger.debug('Loading plugin %s' % name)
|
||||||
spec = importlib.machinery.PathFinder.find_spec(name, path=[pluginpath] )
|
spec = importlib.machinery.PathFinder.find_spec(name, path=[pluginpath] )
|
||||||
if spec:
|
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)
|
logger.debug('Loading plugins from %s...' % pluginpath)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user