Skip to content

Commit

Permalink
Check, that SCons is started with Python 2.7 32-bit and warn the user…
Browse files Browse the repository at this point in the history
… if not. (#8926)

* Ensure, that SCons is started with Python 2.7 32-bit fail otherwise. Fix for #7095

* Improve readability of the displayed message.

* Review actions

* Review actions.
  • Loading branch information
lukaszgo1 authored and michaelDCurran committed Jan 14, 2019
1 parent 2a63710 commit 5fc060b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scons.py
Expand Up @@ -3,6 +3,19 @@

import sys
import os
import platform
# Variables for storing required version of Python, and the version which is used to run this script.
requiredPythonMajor ="2"
requiredPythonMinor = "7"
requiredPythonArchitecture = "32bit"
installedPythonMajor = str(sys.version_info.major)
installedPythonMinor = str(sys.version_info.minor)
installedPythonArchitecture = platform.architecture()[0]
# Ensure, that we are running with required version of Python, otherwise inform the user and exit.
if installedPythonArchitecture != requiredPythonArchitecture or installedPythonMajor != requiredPythonMajor or installedPythonMinor != requiredPythonMinor:
print("This script is started with Python %s.%s %s, however to build NVDA you have to use Python %s.%s %s." %(installedPythonMajor, installedPythonMinor, installedPythonArchitecture, requiredPythonMajor, requiredPythonMinor, requiredPythonArchitecture))
print("Please install the needed version of Python and launch SCons again, or if you have mulltiple versions of Python installed start this script with required version explicitly.")
sys.exit(1)
sys.path.append(os.path.abspath(
os.path.join(__file__, "..", "source")))
import sourceEnv
Expand Down

0 comments on commit 5fc060b

Please sign in to comment.