Skip to content

Commit

Permalink
draft: Fix FileFinder error
Browse files Browse the repository at this point in the history
  • Loading branch information
Rezney committed Apr 12, 2024
1 parent 7f772d6 commit 070a2ef
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion leapp/repository/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import pkgutil
import sys
import importlib.util

from leapp.exceptions import RepoItemPathDoesNotExistError, UnsupportedDefinitionKindError
from leapp.models import get_models, resolve_model_references
Expand Down Expand Up @@ -166,7 +167,9 @@ def _load_modules(self, modules, prefix):
directories = [os.path.join(self._repo_dir, os.path.dirname(module)) for module in modules]
prefix = prefix + '.' if not prefix.endswith('.') else prefix
for importer, name, ispkg in pkgutil.iter_modules(directories, prefix=prefix):
importer.find_module(name).load_module(name)
loader = importer.find_spec(name).loader
module = importlib.util.module_from_spec(loader)
loader.exec_module(module)

def serialize(self):
"""
Expand Down

0 comments on commit 070a2ef

Please sign in to comment.