Skip to contentSkip to conversation

[1.50][PATCH 0/1] Patch review

DISCUSSION Anuj Mittal 1 participant 2 messages Jan 25, 2022

lore
Share & tools
lore
#0 lore raw

Please review this change for 1.50. Tested on autobuilder and no problems seen.

Thanks,

Anuj

The following changes since commit 598ea8584f792b30799231c4d3151d40852fc43c:

tests/fetch: Drop gnu urls from wget connectivity test (2021-12-28 12:39:02 +0800)

are available in the Git repository at:

git://push.openembedded.org/bitbake-contrib stable/1.50-next

Richard Purdie (1):
utils: Update to use exec_module() instead of load_module()

 lib/bb/utils.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

[1.50][PATCH 1/1] utils: Update to use exec_module() instead of load_module()

From: Richard Purdie <[email protected]>

This is deprecated in python 3.12 and Fedora 35 is throwing warnings so move to the new functions.

(cherry picked from commit 68a18fbcb5959e334cf307d7fa8dc63832edb942)
---
 lib/bb/utils.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
lib/bb/utils.py +5 -2
index 40b5006f..2a150fe9 100644
@@ -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
@@ -1620,7 +1621,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.34.1