mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-31340: Change to building with MSVC v141 (included with Visual Studio 2017) (#3311)
This commit is contained in:
parent
bcaac8188b
commit
5fcd5e64ee
10 changed files with 86 additions and 13 deletions
|
@ -318,26 +318,30 @@ class bdist_wininst(Command):
|
|||
# string compares seem wrong, but are what sysconfig.py itself uses
|
||||
if self.target_version and self.target_version < cur_version:
|
||||
if self.target_version < "2.4":
|
||||
bv = 6.0
|
||||
bv = '6.0'
|
||||
elif self.target_version == "2.4":
|
||||
bv = 7.1
|
||||
bv = '7.1'
|
||||
elif self.target_version == "2.5":
|
||||
bv = 8.0
|
||||
bv = '8.0'
|
||||
elif self.target_version <= "3.2":
|
||||
bv = 9.0
|
||||
bv = '9.0'
|
||||
elif self.target_version <= "3.4":
|
||||
bv = 10.0
|
||||
bv = '10.0'
|
||||
else:
|
||||
bv = 14.0
|
||||
bv = '14.0'
|
||||
else:
|
||||
# for current version - use authoritative check.
|
||||
try:
|
||||
from msvcrt import CRT_ASSEMBLY_VERSION
|
||||
except ImportError:
|
||||
# cross-building, so assume the latest version
|
||||
bv = 14.0
|
||||
bv = '14.0'
|
||||
else:
|
||||
bv = float('.'.join(CRT_ASSEMBLY_VERSION.split('.', 2)[:2]))
|
||||
bv = '.'.join(CRT_ASSEMBLY_VERSION.split('.', 2)[:2])
|
||||
if bv == '14.11':
|
||||
# v141 and v140 are binary compatible,
|
||||
# so keep using the 14.0 stub.
|
||||
bv = '14.0'
|
||||
|
||||
|
||||
# wininst-x.y.exe is in the same directory as this file
|
||||
|
@ -353,7 +357,7 @@ class bdist_wininst(Command):
|
|||
else:
|
||||
sfix = ''
|
||||
|
||||
filename = os.path.join(directory, "wininst-%.1f%s.exe" % (bv, sfix))
|
||||
filename = os.path.join(directory, "wininst-%s%s.exe" % (bv, sfix))
|
||||
f = open(filename, "rb")
|
||||
try:
|
||||
return f.read()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue