Check whether a directory contains a file named __init__.py[i]. If so, return the file's name (with dir prefixed). If not, return None. This prefers .pyi over .py (because of the ordering of PY_EXTENSIONS).
(self, dir: str)
| 224 | return module_join(mod_prefix, name), base_dir |
| 225 | |
| 226 | def get_init_file(self, dir: str) -> str | None: |
| 227 | """Check whether a directory contains a file named __init__.py[i]. |
| 228 | |
| 229 | If so, return the file's name (with dir prefixed). If not, return None. |
| 230 | |
| 231 | This prefers .pyi over .py (because of the ordering of PY_EXTENSIONS). |
| 232 | """ |
| 233 | for ext in PY_EXTENSIONS: |
| 234 | f = os.path.join(dir, "__init__" + ext) |
| 235 | if self.fscache.isfile(f): |
| 236 | return f |
| 237 | if ext == ".py" and self.fscache.init_under_package_root(f): |
| 238 | return f |
| 239 | return None |
| 240 | |
| 241 | |
| 242 | def module_join(parent: str, child: str) -> str: |
no test coverage detected