Skip to content

Commit eca162d

Browse files
Update optimum/subpackages.py
1 parent cad0a7c commit eca162d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

optimum/subpackages.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,12 @@ def load_namespace_modules(namespace: str, module: str):
4646
"""
4747
for dist in importlib_metadata.distributions():
4848
dist_name = dist.metadata["Name"]
49-
if dist_name is None or not dist_name.startswith(f"{namespace}-"):
49+
if dist_name is None:
5050
continue
5151
if dist_name == f"{namespace}-benchmark":
5252
continue
53+
if not dist_name.startswith(f"{namespace}-"):
54+
continue
5355
package_import_name = dist_name.replace("-", ".")
5456
module_import_name = f"{package_import_name}.{module}"
5557
if module_import_name in sys.modules:

0 commit comments

Comments
 (0)