Skip to content

Commit

Permalink
snactor: Fix load_module missing in Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
matejmatuska committed Jun 28, 2024
1 parent 03c651c commit e0a2edd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion leapp/snactor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e0a2edd

Please sign in to comment.