fix: Use 3.9 compatible zip (#15177)

<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

Uses a <3.10-compatible version of `zip` since the `strict` argument was
[added in 3.10](https://docs.python.org/3.10/library/functions.html#zip)

## Test Plan

I executed the `_matching_parents` function in a local 3.9 environment

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
Dustin Ngo
2025-08-08 19:45:13 -04:00
committed by GitHub
parent 6b5d309d28
commit 0924490456
2 changed files with 14 additions and 24 deletions
+4 -2
View File
@@ -76,8 +76,10 @@ def _matching_parents(path: str | None, match: str) -> str | None:
if not all(
fnmatch(part, match_part)
for part, match_part in zip(
reversed(parts), reversed(match_parts), strict=False
for part, match_part in (
zip(reversed(parts), reversed(match_parts), strict=False)
if sys.version_info >= (3, 10)
else zip(reversed(parts), reversed(match_parts)) # noqa: B905
)
):
return None