diff --git a/python.bzl b/python.bzl index f4afea901..d7f6446d9 100644 --- a/python.bzl +++ b/python.bzl @@ -1,10 +1,14 @@ def _impl(rctx): # locate python on path, and export it - path = rctx.which("python3.8") + names = ["python3.9", "python3.8", "python3", "python.exe"] + path = None + for name in names: + path = rctx.which(name) + if path: + break + if not path: - path = rctx.which("python.exe") - if not path: - fail("python3.8 or python.exe not found on path") + fail("python3 or python.exe not found on path") rctx.symlink(path, "python") rctx.file("BUILD.bazel", """