diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2022-08-17 20:30:21 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2022-08-17 20:56:20 -0400 |
commit | 7ace3feb7340e2bc387c93745154a1ffab481e86 (patch) | |
tree | ef8d1019aa6c689b32d76df0431f7219d5fc78b1 /setuptools/msvc.py | |
parent | fe8a98e696241487ba6ac9f91faa38ade939ec5d (diff) | |
download | python-setuptools-git-7ace3feb7340e2bc387c93745154a1ffab481e86.tar.gz |
Remove monkeypatching of msvc9compiler. Fixes #3536
Diffstat (limited to 'setuptools/msvc.py')
-rw-r--r-- | setuptools/msvc.py | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/setuptools/msvc.py b/setuptools/msvc.py index 281ea1c2..5d4d7759 100644 --- a/setuptools/msvc.py +++ b/setuptools/msvc.py @@ -3,14 +3,6 @@ Improved support for Microsoft Visual C++ compilers. Known supported compilers: -------------------------- -Microsoft Visual C++ 9.0: - Microsoft Visual C++ Compiler for Python 2.7 (x86, amd64) - Microsoft Windows SDK 6.1 (x86, x64, ia64) - Microsoft Windows SDK 7.0 (x86, x64, ia64) - -Microsoft Visual C++ 10.0: - Microsoft Windows SDK 7.1 (x86, x64, ia64) - Microsoft Visual C++ 14.X: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) @@ -48,100 +40,6 @@ else: environ = dict() -_msvc9_suppress_errors = ( - # msvc9compiler isn't available on some platforms - ImportError, - - # msvc9compiler raises DistutilsPlatformError in some - # environments. See #1118. - distutils.errors.DistutilsPlatformError, -) - -try: - from distutils.msvc9compiler import Reg -except _msvc9_suppress_errors: - pass - - -def msvc9_find_vcvarsall(version): - """ - Patched "distutils.msvc9compiler.find_vcvarsall" to use the standalone - compiler build for Python - (VCForPython / Microsoft Visual C++ Compiler for Python 2.7). - - Fall back to original behavior when the standalone compiler is not - available. - - Redirect the path of "vcvarsall.bat". - - Parameters - ---------- - version: float - Required Microsoft Visual C++ version. - - Return - ------ - str - vcvarsall.bat path - """ - vc_base = r'Software\%sMicrosoft\DevDiv\VCForPython\%0.1f' - key = vc_base % ('', version) - try: - # Per-user installs register the compiler path here - productdir = Reg.get_value(key, "installdir") - except KeyError: - try: - # All-user installs on a 64-bit system register here - key = vc_base % ('Wow6432Node\\', version) - productdir = Reg.get_value(key, "installdir") - except KeyError: - productdir = None - - if productdir: - vcvarsall = join(productdir, "vcvarsall.bat") - if isfile(vcvarsall): - return vcvarsall - - return get_unpatched(msvc9_find_vcvarsall)(version) - - -def msvc9_query_vcvarsall(ver, arch='x86', *args, **kwargs): - """ - Patched "distutils.msvc9compiler.query_vcvarsall" for support extra - Microsoft Visual C++ 9.0 and 10.0 compilers. - - Set environment without use of "vcvarsall.bat". - - Parameters - ---------- - ver: float - Required Microsoft Visual C++ version. - arch: str - Target architecture. - - Return - ------ - dict - environment - """ - # Try to get environment from vcvarsall.bat (Classical way) - try: - orig = get_unpatched(msvc9_query_vcvarsall) - return orig(ver, arch, *args, **kwargs) - except distutils.errors.DistutilsPlatformError: - # Pass error if Vcvarsall.bat is missing - pass - except ValueError: - # Pass error if environment not set after executing vcvarsall.bat - pass - - # If error, try to set environment directly - try: - return EnvironmentInfo(arch, ver).return_env() - except distutils.errors.DistutilsPlatformError as exc: - _augment_exception(exc, ver, arch) - raise - def _msvc14_find_vc2015(): """Python 3.8 "distutils/_msvccompiler.py" backport""" |