Skip to content

Commit

Permalink
misc: small fix or general refactoring i did not bother commenting
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Jan 23, 2025
1 parent 4ad5cfa commit cdb80d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dyana/loaders/pip/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def get_package_import_names(package_name: str) -> set[str]:
import_success = False

# first attempt to import directly
for name in [package_name, normalized_name]:
for name in {package_name, normalized_name}:
# print(f"attempting import with norm name: {name}")
try:
importlib.import_module(normalized_name)
import_success = True
Expand All @@ -98,6 +99,7 @@ def get_package_import_names(package_name: str) -> set[str]:
if not import_success:
import_names = get_package_import_names(package_name)
for name in sorted(import_names, key=len):
# print(f"attempting import with name: {name}")
try:
importlib.import_module(name)
import_success = True
Expand Down

0 comments on commit cdb80d2

Please sign in to comment.