diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-01-04 23:06:50 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-01-05 17:18:11 +0000 |
commit | 655cd3f614d736416eab0d708b7c49674bf5c977 (patch) | |
tree | b0f7f34b43d0e8021e34febcf2c5c58105d776a0 /scripts/lib/wic | |
parent | 6982e2d66bd8296a3f67c72636ce015d328377d0 (diff) | |
download | openembedded-core-contrib-655cd3f614d736416eab0d708b7c49674bf5c977.tar.gz |
scripts: 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 <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic')
-rw-r--r-- | scripts/lib/wic/pluginbase.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/lib/wic/pluginbase.py b/scripts/lib/wic/pluginbase.py index d9b4e57747..b64568339b 100644 --- a/scripts/lib/wic/pluginbase.py +++ b/scripts/lib/wic/pluginbase.py @@ -9,9 +9,11 @@ __all__ = ['ImagerPlugin', 'SourcePlugin'] import os import logging +import types from collections import defaultdict -from importlib.machinery import SourceFileLoader +import importlib +import importlib.util from wic import WicError from wic.misc import get_bitbake_var @@ -54,7 +56,9 @@ class PluginMgr: mname = fname[:-3] mpath = os.path.join(ppath, fname) logger.debug("loading plugin module %s", mpath) - SourceFileLoader(mname, mpath).load_module() + spec = importlib.util.spec_from_file_location(mname, mpath) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) return PLUGINS.get(ptype) |