code: def patch_sys(self, inherit_path):
      
      def patch_dict(old_value, new_value):
        old_value.clear()
        old_value.update(new_value)
  
      def patch_all(path, path_importer_cache, modules):
        sys.path[:] = path
        patch_dict(sys.path_importer_cache, path_importer_cache)
        patch_dict(sys.modules, modules)
  
      new_sys_path, new_sys_path_importer_cache, new_sys_modules = self.minimum_sys(inherit_path)
  
      new_sys_path.extend(merge_split(self._pex_info.pex_path, self._vars.PEX_PATH))
  
      patch_all(new_sys_path, new_sys_path_importer_cache, new_sys_modules)
docs: Patch sys with all site scrubbed.