72 """Find the repair file without importing the package that ships it.
74 ``find_spec`` reads the spec a finder would produce and stops there,
75 so nothing is executed and nothing lands in ``sys.modules``.
76 ``submodule_search_locations`` is the package's own directory list,
77 which answers for a regular package and for a namespace package
78 alike - and the namespace case is exactly the broken venv this file
79 exists to repair, so it must not be the case that crashes.
82 spec = importlib.util.find_spec(REPAIR_PACKAGE)
83 except (ImportError, ValueError):
87 for location
in list(spec.submodule_search_locations
or ()):
88 candidate = Path(location) / REPAIR_FILENAME
89 if candidate.is_file():