Skip to content

Commit

Permalink
Unrolled build for rust-lang#132694
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#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.
  • Loading branch information
rust-timer authored Nov 7, 2024
2 parents fe43131 + e0b98c7 commit aaf1e2d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ for SEARCH_PYTHON in py python3 python python2; do
fi
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
exec "$python" "$xpy" "$@"
fi
Expand Down

0 comments on commit aaf1e2d

Please sign in to comment.