@@ -664,7 +664,7 @@ def __init__(
664
664
for module in CORE_BUILTIN_MODULES :
665
665
if options .use_builtins_fixtures :
666
666
continue
667
- path = self .find_module_cache .find_module (module )
667
+ path = self .find_module_cache .find_module (module , fast_path = True )
668
668
if not isinstance (path , str ):
669
669
raise CompileError (
670
670
[f"Failed to find builtin module { module } , perhaps typeshed is broken?" ]
@@ -2725,7 +2725,9 @@ def exist_added_packages(suppressed: list[str], manager: BuildManager, options:
2725
2725
2726
2726
def find_module_simple (id : str , manager : BuildManager ) -> str | None :
2727
2727
"""Find a filesystem path for module `id` or `None` if not found."""
2728
- x = find_module_with_reason (id , manager )
2728
+ t0 = time .time ()
2729
+ x = manager .find_module_cache .find_module (id , fast_path = True )
2730
+ manager .add_stats (find_module_time = time .time () - t0 , find_module_calls = 1 )
2729
2731
if isinstance (x , ModuleNotFoundReason ):
2730
2732
return None
2731
2733
return x
@@ -2734,7 +2736,7 @@ def find_module_simple(id: str, manager: BuildManager) -> str | None:
2734
2736
def find_module_with_reason (id : str , manager : BuildManager ) -> ModuleSearchResult :
2735
2737
"""Find a filesystem path for module `id` or the reason it can't be found."""
2736
2738
t0 = time .time ()
2737
- x = manager .find_module_cache .find_module (id )
2739
+ x = manager .find_module_cache .find_module (id , fast_path = False )
2738
2740
manager .add_stats (find_module_time = time .time () - t0 , find_module_calls = 1 )
2739
2741
return x
2740
2742
0 commit comments