diff options
| author | Steve Dower <steve.dower@microsoft.com> | 2015-05-23 09:02:50 -0700 |
|---|---|---|
| committer | Steve Dower <steve.dower@microsoft.com> | 2015-05-23 09:02:50 -0700 |
| commit | d034a5ec7f707499139f90eb846b9e720923124c (patch) | |
| tree | 5243db0e3d425b944927bef9f047c0edf5f50fbc /command/bdist_wininst.py | |
| parent | 37ec45e05a5c9b6dfccbfc97caf466496b727616 (diff) | |
| download | python-setuptools-git-d034a5ec7f707499139f90eb846b9e720923124c.tar.gz | |
Issue #23970: Adds distutils._msvccompiler for new Visual Studio versions.
Diffstat (limited to 'command/bdist_wininst.py')
| -rw-r--r-- | command/bdist_wininst.py | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/command/bdist_wininst.py b/command/bdist_wininst.py index 959a8bf6..a3eff7e7 100644 --- a/command/bdist_wininst.py +++ b/command/bdist_wininst.py @@ -303,7 +303,6 @@ class bdist_wininst(Command): return installer_name def get_exe_bytes(self): - from distutils.msvccompiler import get_build_version # If a target-version other than the current version has been # specified, then using the MSVC version from *this* build is no good. # Without actually finding and executing the target version and parsing @@ -313,20 +312,28 @@ class bdist_wininst(Command): # We can then execute this program to obtain any info we need, such # as the real sys.version string for the build. cur_version = get_python_version() - if self.target_version and self.target_version != cur_version: - # If the target version is *later* than us, then we assume they - # use what we use - # string compares seem wrong, but are what sysconfig.py itself uses - if self.target_version > cur_version: - bv = get_build_version() + + # If the target version is *later* than us, then we assume they + # use what we use + # 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 + elif self.target_version == "2.4": + bv = 7.1 + elif self.target_version == "2.5": + bv = 8.0 + elif self.target_version <= "3.2": + bv = 9.0 + elif self.target_version <= "3.4": + bv = 10.0 else: - if self.target_version < "2.4": - bv = 6.0 - else: - bv = 7.1 + bv = 14.0 else: # for current version - use authoritative check. - bv = get_build_version() + from msvcrt import CRT_ASSEMBLY_VERSION + bv = float('.'.join(CRT_ASSEMBLY_VERSION.split('.', 2)[:2])) + # wininst-x.y.exe is in the same directory as this file directory = os.path.dirname(__file__) |
