Skip to content

Commit b1541ff

Browse files
committed
bootstrap.py: Always use .exe for Windows
This ensure that it will run the Windows executable if other files in the directory (such as Linux executables) have the same file name minus the extension.
1 parent a3beeaa commit b1541ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/bootstrap/bootstrap.py

+4
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ def run(args, verbose=False, exception=False, is_bootstrap=False, **kwargs):
152152
if verbose:
153153
print("running: " + ' '.join(args))
154154
sys.stdout.flush()
155+
# Ensure that the .exe is used on Windoows just in case a Linux ELF has been
156+
# compiled in the same directory.
157+
if os.name == 'nt' and not args[0].endswith('.exe'):
158+
args[0] += '.exe'
155159
# Use Popen here instead of call() as it apparently allows powershell on
156160
# Windows to not lock up waiting for input presumably.
157161
ret = subprocess.Popen(args, **kwargs)

0 commit comments

Comments
 (0)