Skip to content

Commit

Permalink
Modifies check for py launcher
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sidshank committed Apr 11, 2024
1 parent f7262b7 commit e33c570
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/extractor/buildtools/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@

WIN = sys.platform == "win32"


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

0 comments on commit e33c570

Please sign in to comment.