[V3 Downloader] Stop including subpackages in cog list (#2590)

Before this change, `Repo.available_modules` would also contain subpackages, which is unintended
This commit is contained in:
jack1142 2019-04-23 02:07:52 +02:00 committed by Will
parent eaeaf9dd69
commit 46413c2c52

View File

@ -173,9 +173,7 @@ class Repo(RepoJSONMixin):
Installable(location=name)
)
"""
for file_finder, name, is_pkg in pkgutil.walk_packages(
path=[str(self.folder_path)], onerror=lambda name: None
):
for file_finder, name, is_pkg in pkgutil.iter_modules(path=[str(self.folder_path)]):
if is_pkg:
curr_modules.append(Installable(location=self.folder_path / name))
self.available_modules = curr_modules