Bump minimum Python version (#1581)

Bump minimum Python version to 3.6.
This commit is contained in:
Rick Gibbed 2020-03-30 17:37:32 -05:00 committed by GitHub
parent 5f5e281e8c
commit a0f486b0fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

10
xb.bat
View File

@ -10,7 +10,7 @@ REM ============================================================================
CALL :check_python
IF %_RESULT% NEQ 0 (
ECHO.
ECHO Python 3.4+ must be installed and on PATH:
ECHO Python 3.6+ must be installed and on PATH:
ECHO https://www.python.org/
GOTO :eof
)
@ -35,9 +35,7 @@ SET FOUND_PATH=""
SET "CANDIDATE_PATHS[0]=C:\python37\python.exe"
SET "CANDIDATE_PATHS[1]=C:\python36\python.exe"
SET "CANDIDATE_PATHS[2]=C:\python35\python.exe"
SET "CANDIDATE_PATHS[3]=C:\python34\python.exe"
SET OUTPUT_INDEX=4
SET OUTPUT_INDEX=2
FOR /F "usebackq delims=" %%L IN (`2^>NUL where python3`) DO (
IF %%~zL NEQ 0 (
@ -72,9 +70,9 @@ IF "%FOUND_PATH%"=="" (
GOTO :eof
)
CMD /C ""%FOUND_PATH%" -c "import sys; sys.exit(1 if not sys.version_info[:2] ^>= (3, 4) else 0)"
CMD /C ""%FOUND_PATH%" -c "import sys; sys.exit(1 if not sys.version_info[:2] ^>= (3, 6) else 0)"
IF %ERRORLEVEL% NEQ 0 (
ECHO ERROR: Python version mismatch, not at least 3.4.
ECHO ERROR: Python version mismatch, not at least 3.6.
ECHO Found Python executable was "%FOUND_PATH%".
ENDLOCAL & SET _RESULT=1
GOTO :eof

View File

@ -38,8 +38,8 @@ def main():
sys.exit(1)
# Check python version.
if not sys.version_info[:2] >= (3, 4):
print('ERROR: Python 3.4+ must be installed and on PATH')
if not sys.version_info[:2] >= (3, 6):
print('ERROR: Python 3.6+ must be installed and on PATH')
sys.exit(1)
# Grab Visual Studio version and execute shell to set up environment.