summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2017-09-06 10:01:38 -0700
committerGitHub <noreply@github.com>2017-09-06 10:01:38 -0700
commit91a97f1145f3d78667b162907af985b8d6fcc61a (patch)
treeb4fa3081ae84a8d6aeeeea228acd29908709ca66
parentc3052243e0aa7e756645a116fef7ed9ff09bfd5e (diff)
downloadpython-setuptools-git-91a97f1145f3d78667b162907af985b8d6fcc61a.tar.gz
bpo-31340: Change to building with MSVC v141 (included with Visual Studio 2017) (#3311)
-rw-r--r--command/bdist_wininst.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/command/bdist_wininst.py b/command/bdist_wininst.py
index d3e1d3af..6309c3e2 100644
--- a/command/bdist_wininst.py
+++ b/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()