Skip to content

Commit 40911c1

Browse files
authored
Merge pull request #3741 from mgorny/msvc-hack
Remove msvc hack for Numpy < 1.11.2
2 parents 56ef50b + 9f783ac commit 40911c1

File tree

3 files changed

+2
-23
lines changed

3 files changed

+2
-23
lines changed

changelog.d/3741.breaking.rst

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Removed patching of ``distutils._msvccompiler.gen_lib_options``
2+
for compatibility with Numpy < 1.11.2 -- by :user:`mgorny`

setuptools/monkey.py

-6
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,3 @@ def patch_params(mod_name, func_name):
157157
patch_func(*msvc14('_get_vc_env'))
158158
except ImportError:
159159
pass
160-
161-
try:
162-
# Patch distutils._msvccompiler.gen_lib_options for Numpy
163-
patch_func(*msvc14('gen_lib_options'))
164-
except ImportError:
165-
pass

setuptools/msvc.py

-17
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,13 @@
1515
from io import open
1616
from os import listdir, pathsep
1717
from os.path import join, isfile, isdir, dirname
18-
import sys
1918
import contextlib
2019
import platform
2120
import itertools
2221
import subprocess
2322
import distutils.errors
24-
from setuptools.extern.packaging.version import LegacyVersion
2523
from setuptools.extern.more_itertools import unique_everseen
2624

27-
from .monkey import get_unpatched
28-
2925
if platform.system() == 'Windows':
3026
import winreg
3127
from os import environ
@@ -217,19 +213,6 @@ def msvc14_get_vc_env(plat_spec):
217213
raise
218214

219215

220-
def msvc14_gen_lib_options(*args, **kwargs):
221-
"""
222-
Patched "distutils._msvccompiler.gen_lib_options" for fix
223-
compatibility between "numpy.distutils" and "distutils._msvccompiler"
224-
(for Numpy < 1.11.2)
225-
"""
226-
if "numpy.distutils" in sys.modules:
227-
import numpy as np
228-
if LegacyVersion(np.__version__) < LegacyVersion('1.11.2'):
229-
return np.distutils.ccompiler.gen_lib_options(*args, **kwargs)
230-
return get_unpatched(msvc14_gen_lib_options)(*args, **kwargs)
231-
232-
233216
def _augment_exception(exc, version, arch=''):
234217
"""
235218
Add details to the exception message to help guide the user

0 commit comments

Comments
 (0)