diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-01-04 23:07:03 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-01-05 17:18:34 +0000 |
commit | 7c7e53570c8171cc0d3729e4d507b4bd0ca82167 (patch) | |
tree | 937786150c3bd2c381c93a77b5420e4339b86f8b | |
parent | fc2bc42eecfb03c6bf8d35b4ef2d3af6a5f13fcb (diff) | |
download | poky-7c7e53570c8171cc0d3729e4d507b4bd0ca82167.tar.gz |
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>
-rw-r--r-- | bitbake/lib/bb/utils.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index d890ea832e..1a51589704 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py | |||
@@ -16,7 +16,8 @@ import bb.msg | |||
16 | import multiprocessing | 16 | import multiprocessing |
17 | import fcntl | 17 | import fcntl |
18 | import importlib | 18 | import importlib |
19 | from importlib import machinery | 19 | import importlib.machinery |
20 | import importlib.util | ||
20 | import itertools | 21 | import itertools |
21 | import subprocess | 22 | import subprocess |
22 | import glob | 23 | import glob |
@@ -1620,7 +1621,9 @@ def load_plugins(logger, plugins, pluginpath): | |||
1620 | logger.debug('Loading plugin %s' % name) | 1621 | logger.debug('Loading plugin %s' % name) |
1621 | spec = importlib.machinery.PathFinder.find_spec(name, path=[pluginpath] ) | 1622 | spec = importlib.machinery.PathFinder.find_spec(name, path=[pluginpath] ) |
1622 | if spec: | 1623 | if spec: |
1623 | return spec.loader.load_module() | 1624 | mod = importlib.util.module_from_spec(spec) |
1625 | spec.loader.exec_module(mod) | ||
1626 | return mod | ||
1624 | 1627 | ||
1625 | logger.debug('Loading plugins from %s...' % pluginpath) | 1628 | logger.debug('Loading plugins from %s...' % pluginpath) |
1626 | 1629 | ||