Look up the most recent date among paths from the bulk cache.
(paths: list[str], lib_prefix: str)
| 1180 | |
| 1181 | |
| 1182 | def _lookup_last_updated(paths: list[str], lib_prefix: str) -> str | None: |
| 1183 | """Look up the most recent date among paths from the bulk cache.""" |
| 1184 | cache = _bulk_last_updated() |
| 1185 | prefix = _lib_prefix_stripped(lib_prefix) |
| 1186 | latest = None |
| 1187 | for p in paths: |
| 1188 | p_norm = pathlib.Path(p).as_posix() |
| 1189 | # Strip lib_prefix to get Lib-relative key |
| 1190 | # e.g. "Lib/test/test_os.py" -> "test/test_os.py" |
| 1191 | # "../Lib/re" -> "re" |
| 1192 | if p_norm.startswith(prefix): |
| 1193 | key = p_norm[len(prefix) :] |
| 1194 | else: |
| 1195 | key = p_norm |
| 1196 | date = cache.get(key) |
| 1197 | if date and (latest is None or date > latest): |
| 1198 | latest = date |
| 1199 | return latest |
| 1200 | |
| 1201 | |
| 1202 | def get_module_last_updated( |
no test coverage detected