Function
_load_directories
(site_dirs: Iterable[Path])
Source from the content-addressed store, hash-verified
| 26 | |
| 27 | @contextmanager |
| 28 | def _load_directories(site_dirs: Iterable[Path]) -> Iterator[None]: |
| 29 | plugin_dirs = [ |
| 30 | os.fspath(site_dir) |
| 31 | for site_dir in site_dirs |
| 32 | ] |
| 33 | sys.path.extend(plugin_dirs) |
| 34 | try: |
| 35 | yield |
| 36 | finally: |
| 37 | for plugin_dir in plugin_dirs: |
| 38 | sys.path.remove(plugin_dir) |
| 39 | |
| 40 | |
| 41 | def enable_plugins(plugins_dir: Optional[Path]) -> ContextManager[None]: |
Tested by
no test coverage detected