Skip to content

Commit

Permalink
rename method, clarify debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-hurst committed Oct 24, 2024
1 parent 005752d commit 39ae6a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rpm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ def import_helper(path: Path, suffixes: List) -> None:
f"Module {e.name} not found in {path}, "
"looking for any binary extensions with valid suffixes"
)
try_import_binary_modules(path, e.name, suffixes)
try_import_binary_extension(path, e.name, suffixes)
else:
logger.debug(f"Reloaded {__name__}")
return


def try_import_binary_modules(path: Path, module: str, suffixes: List) -> bool:
def try_import_binary_extension(path: Path, module: str, suffixes: List) -> bool:
"""
Finds and imports binary modules in {path} matching {name} and {suffixes}
Finds and imports a binary extension in {path} matching {module} and {suffixes}
Args:
path (Path): the path to a module, i.e. /usr/lib64/python3.9/site-packages/rpm/
Expand All @@ -148,7 +148,7 @@ def try_import_binary_modules(path: Path, module: str, suffixes: List) -> bool:
# if so we'll try loading it as rpm._rpm
so = path / f"{child}{suffix}"
if not so.is_file():
logger.debug(f"{so} exists but isn't a file, ignoring")
logger.debug(f"{so} isn't a file, ignoring")
continue
if load_module_by_path(module, so):
return True
Expand Down

0 comments on commit 39ae6a8

Please sign in to comment.