From e0a2edd6cd89c96944b8f62c1229dfc37e35b349 Mon Sep 17 00:00:00 2001 From: Matej Matuska Date: Fri, 28 Jun 2024 14:34:15 +0200 Subject: [PATCH] snactor: Fix load_module missing in Python 3.12 --- leapp/snactor/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/leapp/snactor/__init__.py b/leapp/snactor/__init__.py index 22ea99371..7ffc40144 100644 --- a/leapp/snactor/__init__.py +++ b/leapp/snactor/__init__.py @@ -30,7 +30,9 @@ def _load_commands_from(path): for importer, name, is_pkg in pkgutil.iter_modules([pkg_path]): if is_pkg: continue - mod = importer.find_module(name).load_module(name) + spec = importer.find_spec(name) + mod = importlib.util.module_from_spec(spec) + #sys.modules[name] = module if hasattr(mod.cli, 'command'): if not mod.cli.command.parent: cli.command.add_sub(mod.cli.command)