Skip to content

Commit 5fc7ec0

Browse files
committed
fix: Ensure that repository access is resilient against namespace packages
1 parent 851dc57 commit 5fc7ec0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/firewheel/control/repository_db.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ def list_repositories(self):
6868

6969
# Add all model components that have been added via entry points
7070
for entry in entry_points(group="firewheel.mc_repo"):
71-
entries.append({"path": entry.load()[0]})
71+
# Typically `entry` is a `__path__` attribute of a module; this attribute
72+
# is defined as a sequence of strings enumerating the locations where the
73+
# package's submodules will be found
74+
# https://docs.python.org/3/reference/import.html#path-attributes-on-modules
75+
for path in entry.load():
76+
entries.append({"path": path})
7277

7378
return iter(entries)
7479

0 commit comments

Comments
 (0)