fix(python): match two-digit minor versions in pyuserpaths (#14161)

The version pattern used the shortest match (#), so "Python 3.11.4"
was truncated to 3.1 and the ~/.local/lib/python3.11/site-packages
check never matched on python >= 3.10, leaving pyuserpaths a no-op.
Use a longest match (##) so the whole minor version is kept.
This commit is contained in:
Zhiqi Zhang
2026-10-08 16:46:10 -07:00
committed by GitHub
parent 3d9b557be3
commit 361fb5c1ac
+1 -1
View File
@@ -29,7 +29,7 @@ function pyuserpaths() {
# Get minor release version.
# The patch version is variable length, truncate it.
version=${(M)${"$($python -V 2>&1)":7}#[^.]##.[^.]##}
version=${(M)${"$($python -V 2>&1)":7}##[^.]##.[^.]##}
# Add version specific path, if:
# - it exists in the filesystem