mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[TEMP] Is it a FileFinder cache issue??
This commit is contained in:
parent
ee7047f27a
commit
3f362cd93e
1 changed files with 6 additions and 1 deletions
|
|
@ -220,11 +220,16 @@ def global_cache(self) -> list[pkgutil.ModuleInfo]:
|
||||||
print('getting packages/') # TEMPORARY -- debugging tests on windows
|
print('getting packages/') # TEMPORARY -- debugging tests on windows
|
||||||
self._global_cache = list(pkgutil.iter_modules())
|
self._global_cache = list(pkgutil.iter_modules())
|
||||||
# === BEGIN TEMPORARY -- debugging tests on windows ===
|
# === BEGIN TEMPORARY -- debugging tests on windows ===
|
||||||
print(f"\n\n{self._global_cache=}\n\n")
|
|
||||||
mymod = next((p for p in self._global_cache if p.name == "mymodule"), None)
|
mymod = next((p for p in self._global_cache if p.name == "mymodule"), None)
|
||||||
if mymod:
|
if mymod:
|
||||||
print("0a", mymod)
|
print("0a", mymod)
|
||||||
|
import glob
|
||||||
|
print("files on finder path:", glob.glob("**", root_dir=mymod.module_finder.path, recursive=True))
|
||||||
spec = mymod.module_finder.find_spec(mymod.name, None)
|
spec = mymod.module_finder.find_spec(mymod.name, None)
|
||||||
|
print("found spec:", spec)
|
||||||
|
mymod.module_finder.invalidate_caches()
|
||||||
|
spec = mymod.module_finder.find_spec(mymod.name, None)
|
||||||
|
print("found spec after invalidate:", spec)
|
||||||
if spec:
|
if spec:
|
||||||
print("1")
|
print("1")
|
||||||
assert spec.submodule_search_locations and len(spec.submodule_search_locations) == 1
|
assert spec.submodule_search_locations and len(spec.submodule_search_locations) == 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue