Global module cache
(self)
| 263 | |
| 264 | @property |
| 265 | def global_cache(self) -> list[pkgutil.ModuleInfo]: |
| 266 | """Global module cache""" |
| 267 | if not self._global_cache or self._curr_sys_path != sys.path: |
| 268 | self._curr_sys_path = sys.path[:] |
| 269 | self._global_cache = list(pkgutil.iter_modules()) |
| 270 | self._failed_imports.clear() # retry on sys.path change |
| 271 | return self._global_cache |
| 272 | |
| 273 | def _maybe_import_module(self, fqname: str) -> ModuleType | None: |
| 274 | if any(pattern.fullmatch(fqname) for pattern in AUTO_IMPORT_DENYLIST): |