diff --git a/Lib/_pyrepl/_module_completer.py b/Lib/_pyrepl/_module_completer.py index dac480fb78d..e177ecaa7e9 100644 --- a/Lib/_pyrepl/_module_completer.py +++ b/Lib/_pyrepl/_module_completer.py @@ -130,12 +130,15 @@ def _find_modules(self, path: str, prefix: str) -> list[str]: for segment in path.split('.'): modules = [mod_info for mod_info in modules if mod_info.ispkg and mod_info.name == segment] + print(f"{segment=}, {modules=}") # TEMPORARY -- debugging tests on windows if is_stdlib_import is None: # Top-level import decide if we import from stdlib or not is_stdlib_import = all( self._is_stdlib_module(mod_info) for mod_info in modules ) modules = self.iter_submodules(modules) + modules = list(modules) # TEMPORARY -- debugging tests on windows + print(f"segment=last, {modules=}") # TEMPORARY -- debugging tests on windows module_names = [module.name for module in modules] if is_stdlib_import: diff --git a/Lib/test/test_pyrepl/test_pyrepl.py b/Lib/test/test_pyrepl/test_pyrepl.py index c58c1efcbf7..591945d3d04 100644 --- a/Lib/test/test_pyrepl/test_pyrepl.py +++ b/Lib/test/test_pyrepl/test_pyrepl.py @@ -1139,6 +1139,7 @@ def test_already_imported_custom_module_no_other_suggestions(self): self.assertEqual(output, "import mymodule.foo") del sys.modules["mymodule"] + print(f"{dir1=}, {dir2=}") # TEMPORARY -- debugging tests on windows # mymodule not imported anymore -> suggest dir2 submodules events = code_to_events("import mymodule.\t\n") reader = self.prepare_reader(events, namespace={})