diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2018-06-28 19:23:39 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2018-06-29 07:08:46 -0600 |
commit | 929b25cd9437cf0bc8cb3bb8165d711fb680293b (patch) | |
tree | a783228c6d516b2fabdb3f0d8342fc6b9d82b5f4 /numpy/distutils/misc_util.py | |
parent | cd731d5cdbac143b9de5e188b74e03514d3c73b8 (diff) | |
download | numpy-929b25cd9437cf0bc8cb3bb8165d711fb680293b.tar.gz |
BUG: Revert #10229 to fix DLL loads on Windows.
Numpy wheels on Windows were clearing the ctypes path when they loaded
the OpenBLAS DLL, leading to failure of DLL loads subsequent to NumPy
import because the needed DLLs could not be found.
This isn't a straight revert, it restores to the 1.15.x version of
the relevant code.
Closes #11431.
Diffstat (limited to 'numpy/distutils/misc_util.py')
-rw-r--r-- | numpy/distutils/misc_util.py | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/numpy/distutils/misc_util.py b/numpy/distutils/misc_util.py index 186ed949d..8305aeae5 100644 --- a/numpy/distutils/misc_util.py +++ b/numpy/distutils/misc_util.py @@ -2300,19 +2300,9 @@ import sys extra_dll_dir = os.path.join(os.path.dirname(__file__), '.libs') -if os.path.isdir(extra_dll_dir) and sys.platform == 'win32': - try: - from ctypes import windll, c_wchar_p - _AddDllDirectory = windll.kernel32.AddDllDirectory - _AddDllDirectory.argtypes = [c_wchar_p] - # Needed to initialize AddDllDirectory modifications - windll.kernel32.SetDefaultDllDirectories(0x1000) - except AttributeError: - def _AddDllDirectory(dll_directory): - os.environ.setdefault('PATH', '') - os.environ['PATH'] += os.pathsep + dll_directory - - _AddDllDirectory(extra_dll_dir) +if sys.platform == 'win32' and os.path.isdir(extra_dll_dir): + os.environ.setdefault('PATH', '') + os.environ['PATH'] += os.pathsep + extra_dll_dir """) |