Return the minimum sys necessary to run this interpreter, a la python -S. :returns: (sys.path, sys.path_importer_cache, sys.modules) tuple of a bare python installation.
(self, inherit_path)
| 450 | return scrubbed_sys_path, scrubbed_importer_cache |
| 451 | |
| 452 | def minimum_sys(self, inherit_path): |
| 453 | # type: (InheritPath.Value) -> Tuple[List[str], Mapping[str, Any], Mapping[str, ModuleType]] |
| 454 | """Return the minimum sys necessary to run this interpreter, a la python -S. |
| 455 | |
| 456 | :returns: (sys.path, sys.path_importer_cache, sys.modules) tuple of a |
| 457 | bare python installation. |
| 458 | """ |
| 459 | isolated_sys_path = IsolatedSysPath.for_pex( |
| 460 | interpreter=self._interpreter, pex=self._pex, pex_pex=self._vars.PEX |
| 461 | ) |
| 462 | sys_path, sys_path_importer_cache = self.minimum_sys_path(isolated_sys_path, inherit_path) |
| 463 | sys_modules = self.minimum_sys_modules(isolated_sys_path) |
| 464 | |
| 465 | return sys_path, sys_path_importer_cache, sys_modules |
| 466 | |
| 467 | # Thar be dragons -- when this function exits, the interpreter is potentially in a wonky state |
| 468 | # since the patches here (minimum_sys_modules for example) actually mutate global state. |
no test coverage detected