Skip to content

Commit fb4256e

Browse files
authored
Use submodule_search_locations correctly (#180)
1 parent 89f1f79 commit fb4256e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

support/walk-modules.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,12 @@ def walk(mod_name: str, io: Writer) -> None:
7878
try:
7979
locations = mod.__spec__.submodule_search_locations
8080
except AttributeError:
81-
walk_naive(mod_name, mod, io)
82-
else:
81+
locations = None
82+
83+
if locations is not None:
8384
walk_pkgutil(mod_name, locations, io)
85+
else:
86+
walk_naive(mod_name, mod, io)
8487

8588

8689
if __name__ == "__main__":

0 commit comments

Comments
 (0)