(import_path: str, raising: bool)
| 91 | |
| 92 | |
| 93 | def derive_importpath(import_path: str, raising: bool) -> Tuple[str, object]: |
| 94 | if not isinstance(import_path, str) or "." not in import_path: |
| 95 | raise TypeError(f"must be absolute import path string, not {import_path!r}") |
| 96 | module, attr = import_path.rsplit(".", 1) |
| 97 | target = resolve(module) |
| 98 | if raising: |
| 99 | annotated_getattr(target, attr, ann=module) |
| 100 | return attr, target |
| 101 | |
| 102 | |
| 103 | class Notset: |
no test coverage detected