Skip to content

Commit 3f362cd

Browse files
authored
[TEMP] Is it a FileFinder cache issue??
1 parent ee7047f commit 3f362cd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Lib/_pyrepl/_module_completer.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,16 @@ def global_cache(self) -> list[pkgutil.ModuleInfo]:
220220
print('getting packages/') # TEMPORARY -- debugging tests on windows
221221
self._global_cache = list(pkgutil.iter_modules())
222222
# === BEGIN TEMPORARY -- debugging tests on windows ===
223-
print(f"\n\n{self._global_cache=}\n\n")
224223
mymod = next((p for p in self._global_cache if p.name == "mymodule"), None)
225224
if mymod:
226225
print("0a", mymod)
226+
import glob
227+
print("files on finder path:", glob.glob("**", root_dir=mymod.module_finder.path, recursive=True))
227228
spec = mymod.module_finder.find_spec(mymod.name, None)
229+
print("found spec:", spec)
230+
mymod.module_finder.invalidate_caches()
231+
spec = mymod.module_finder.find_spec(mymod.name, None)
232+
print("found spec after invalidate:", spec)
228233
if spec:
229234
print("1")
230235
assert spec.submodule_search_locations and len(spec.submodule_search_locations) == 1

0 commit comments

Comments
 (0)