Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e14c2ff

Browse files
authored
Make runtests.py use the "py -3" launcher on Windows (#5418)
Most Windows installations don't have an exe named "python3" -- the convention is to instead use the "py" launcher. As a note, we probably already have some helper method that gets the correct Python exe name somewhere, but iirc the intent was to keep runtests.py simple, so I just implemented it directly.
1 parent ee7b511 commit e14c2ff

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

runtests.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
#!/usr/bin/env python3
22
from os import system
3-
from sys import argv, exit
3+
from sys import argv, exit, platform
44

55
prog, *args = argv
66

7+
if platform == 'win32':
8+
python_name = 'py -3'
9+
else:
10+
python_name = 'python3'
11+
712
cmds = {
8-
'self': 'python3 -m mypy --config-file mypy_self_check.ini -p mypy',
13+
'self': python_name + ' -m mypy --config-file mypy_self_check.ini -p mypy',
914
'lint': 'flake8 -j0',
1015
'pytest': 'pytest'
1116
}

0 commit comments

Comments
 (0)