mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-10-20 04:12:06 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user