Skip to content

Commit

Permalink
[infra] Fix vs_toolchain.py
Browse files Browse the repository at this point in the history
Pass shell=True when invoking python, without
this flag Windows own python.exe is selected
even though it is shadowed in the PATH by
depot_tools' python.bat.

Change-Id: Ia581853ff5819f97f872761ff7557ba9d6028beb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200875
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
  • Loading branch information
mraleph authored and commit-bot@chromium.org committed May 21, 2021
1 parent d9f03e9 commit f364c8b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion build/vs_toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,9 @@ def Update(force=False, no_download=False):

get_toolchain_args = [
# TODO(athom): use sys.executable (python3).
# Note: depot_tools contains python.bat not python.exe
# so for python to land on the first python in the PATH
# irrespective of its extension we pass shell=True below.
'python',
os.path.join(depot_tools_path, 'win_toolchain',
'get_toolchain_if_necessary.py'),
Expand All @@ -537,7 +540,7 @@ def Update(force=False, no_download=False):
get_toolchain_args.append('--force')
if no_download:
get_toolchain_args.append('--no-download')
subprocess.check_call(get_toolchain_args)
subprocess.check_call(get_toolchain_args, shell=True)

return 0

Expand Down

0 comments on commit f364c8b

Please sign in to comment.