They work fine with Python 2.7 and Python 3.5 anyway and some systems do not
have a "python2" binary (e.g. macOS). This will fix the Gerrit CI build on
Bazel's CI, which is currently failing with:
ERROR: /Users/buildkite/builds/buildkite-macpro-7-1/bazel-downstream-projects/gerrit/Documentation/BUILD:94:1: Couldn't build file Documentation/pg-plugin-endpoints.txt.html_htmlonly_expn: error executing shell command: '.html_htmlonly_expn' failed (Exit 127)
env: python2: No such file or directory
I tested this change like this:
# Build with Python 2 to ensure my local setup is fine.
bazel build //Documentation/...
# Works fine.
# Now build with Python 3 instead, to ensure compatibility.
sed -i 's/python2/python3/g' Documentation/replace_macros.py \
tools/bzl/license.bzl
bazel clean
bazel build //Documentation/...
# Works fine, too.
Thus we can safely change "python2" to "python" and let the scripts run with
the system default version.
Change-Id: I107b76bc71e9b42101d57f94ab7c54c90e7c74cb