Load a custom module, and return it.
(self)
| 5322 | return |
| 5323 | |
| 5324 | def __load(self) -> ModuleType: |
| 5325 | """Load a custom module, and return it.""" |
| 5326 | fpath = self.path |
| 5327 | spec = importlib.util.spec_from_file_location(fpath.stem, fpath) |
| 5328 | module = importlib.util.module_from_spec(spec) |
| 5329 | sys.modules[fpath.stem] = module |
| 5330 | spec.loader.exec_module(module) |
| 5331 | return module |
| 5332 | |
| 5333 | def __str__(self) -> str: |
| 5334 | return self.name |