From 680812a901846fcbc120d832d8faaa56fba07f28 Mon Sep 17 00:00:00 2001 From: Adam Turner <9087854+aa-turner@users.noreply.github.com> Date: Tue, 19 Aug 2025 17:00:00 +0100 Subject: [PATCH] Use ``submodule_search_locations`` correctly --- support/walk-modules.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/support/walk-modules.py b/support/walk-modules.py index 114e2ec..9b73cec 100755 --- a/support/walk-modules.py +++ b/support/walk-modules.py @@ -78,9 +78,12 @@ def walk(mod_name: str, io: Writer) -> None: try: locations = mod.__spec__.submodule_search_locations except AttributeError: - walk_naive(mod_name, mod, io) - else: + locations = None + + if locations is not None: walk_pkgutil(mod_name, locations, io) + else: + walk_naive(mod_name, mod, io) if __name__ == "__main__":