summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/command/bdist_wininst.py
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2017-09-06 17:01:38 (GMT)
committerGitHub <noreply@github.com>2017-09-06 17:01:38 (GMT)
commit5fcd5e64eec9ed67613b8fe7356fb8288151ceba (patch)
tree7f439fe482a133d7877977a255d518a5ee846024 /Lib/distutils/command/bdist_wininst.py
parentbcaac8188b1a1e67d2cc155609f0f883f036df33 (diff)
downloadcpython-5fcd5e64eec9ed67613b8fe7356fb8288151ceba.zip
cpython-5fcd5e64eec9ed67613b8fe7356fb8288151ceba.tar.gz
cpython-5fcd5e64eec9ed67613b8fe7356fb8288151ceba.tar.bz2
bpo-31340: Change to building with MSVC v141 (included with Visual Studio 2017) (#3311)
Diffstat (limited to 'Lib/distutils/command/bdist_wininst.py')
-rw-r--r--Lib/distutils/command/bdist_wininst.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py
index d3e1d3a..6309c3e 100644
--- a/Lib/distutils/command/bdist_wininst.py
+++ b/Lib/distutils/command/bdist_wininst.py
@@ -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()