Find all modules under 'path' that start with 'prefix'.
(self, path: str, prefix: str)
| 108 | return sorted({*submodules, *attributes}), action |
| 109 | |
| 110 | def find_modules(self, path: str, prefix: str) -> list[str]: |
| 111 | """Find all modules under 'path' that start with 'prefix'.""" |
| 112 | modules = self._find_modules(path, prefix) |
| 113 | # Filter out invalid module names |
| 114 | # (for example those containing dashes that cannot be imported with 'import') |
| 115 | return [mod for mod in modules if mod.isidentifier()] |
| 116 | |
| 117 | def _find_modules(self, path: str, prefix: str) -> list[str]: |
| 118 | if not path: |
no test coverage detected