Rollup merge of #132694 - ismailarilik:fix/x/fix-a-regex-used-to-find-python-executable, r=jieyouxu

fix(x): fix a regex used to find python executable

Isn't the regex `^python[2-3]\.[0-9]\+$` wrong? It doesn't match, for example, with `python2.8`. There should be a plus sign at the end for a match, like `python2.8+`. I think `[0-9]+` is meant here instead of `[0-9]\+`. In that case a string like `python2.8` would match. This wasn't noticed because the script probably find and run the Python executable before this line.
This commit is contained in:
Jonas Böttiger 2024-11-07 13:08:28 +01:00 committed by GitHub
commit 7044cc7447
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

2
x
View File

@ -36,7 +36,7 @@ for SEARCH_PYTHON in py python3 python python2; do
fi fi
done done
python=$(bash -c "compgen -c python" | grep '^python[2-3]\.[0-9]\+$' | head -n1) python=$(bash -c "compgen -c python" | grep '^python[2-3]\.[0-9]+$' | head -n1)
if ! [ "$python" = "" ]; then if ! [ "$python" = "" ]; then
exec "$python" "$xpy" "$@" exec "$python" "$xpy" "$@"
fi fi