Skip to content

Commit e33c570

Browse files
committed
Modifies check for py launcher
This commit modifies the check for the "py" launcher on windows. We now look for the launcher only if the python_executable_name extractor option is not specified.
1 parent f7262b7 commit e33c570

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/extractor/buildtools/version.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
WIN = sys.platform == "win32"
2020

21-
22-
if WIN:
21+
if WIN and "CODEQL_EXTRACTOR_PYTHON_OPTION_PYTHON_EXECUTABLE_NAME" not in os.environ:
2322
# installing `py` launcher is optional when installing Python on windows, so it's
2423
# possible that the user did not install it, see
2524
# https://github.com/github/codeql-cli-binaries/issues/125#issuecomment-1157429430
26-
# so we check whether it has been installed. Newer versions have a `--list` option,
25+
# so we check whether it has been installed, and we check only if the "python_executable_name"
26+
# extractor option has not been specified. Newer versions have a `--list` option,
2727
# but that has only been mentioned in the docs since 3.9, so to not risk it not
2828
# working on potential older versions, we'll just use `py --version` which forwards
2929
# the `--version` argument to the default python executable.

0 commit comments

Comments
 (0)