(match: re.Match[str])
| 131 | changed_any = False |
| 132 | |
| 133 | def _replacement(match: re.Match[str]) -> str: |
| 134 | prefix, raw_path, suffix = match.groups() |
| 135 | normalized = raw_path.replace("\\", "/") |
| 136 | if _is_forward_slash_absolute(normalized) and not _has_dot_components( |
| 137 | normalized |
| 138 | ): |
| 139 | absolute = normalized |
| 140 | else: |
| 141 | absolute = (build_dir / normalized).resolve().as_posix() |
| 142 | if absolute == raw_path: |
| 143 | return match.group(0) |
| 144 | return f"{prefix}{absolute}{suffix}" |
| 145 | |
| 146 | def _normalize_text(content: str) -> str: |
| 147 | return _STRICT_PATH_FLAG_RE.sub(_replacement, content) |
nothing calls this directly
no test coverage detected