| 781 | return False |
| 782 | |
| 783 | def _load_module_from_path(self, module_name: str, path: str, *, is_package: bool) -> Any: |
| 784 | importlib.invalidate_caches() |
| 785 | spec = importlib.util.spec_from_file_location( |
| 786 | module_name, |
| 787 | path, |
| 788 | submodule_search_locations=[os.path.dirname(path)] if is_package else None, |
| 789 | ) |
| 790 | if spec is None or spec.loader is None: |
| 791 | raise ImportError(f"Could not load spec for {module_name} from {path}") |
| 792 | module = importlib.util.module_from_spec(spec) |
| 793 | sys.modules[module_name] = module |
| 794 | spec.loader.exec_module(module) |
| 795 | return module |
| 796 | |
| 797 | def _get_reload_token(self) -> float: |
| 798 | try: |