If path starts with prefix, return copy of path with the prefix removed. Otherwise, return path. If path is None, return None.
(path: str, prefix: str | None)
| 1312 | |
| 1313 | |
| 1314 | def remove_path_prefix(path: str, prefix: str | None) -> str: |
| 1315 | """If path starts with prefix, return copy of path with the prefix removed. |
| 1316 | Otherwise, return path. If path is None, return None. |
| 1317 | """ |
| 1318 | if prefix is not None and path.startswith(prefix): |
| 1319 | return path[len(prefix) :] |
| 1320 | else: |
| 1321 | return path |
| 1322 | |
| 1323 | |
| 1324 | def report_internal_error( |
no test coverage detected
searching dependent graphs…