8000 BUG: Find only platform-specific dlls in winsxs directory. · numpy/numpy@c17738a · GitHub
[go: up one dir, main page]

Skip to content

Commit c17738a

Browse files
87charris
authored andcommitted
BUG: Find only platform-specific dlls in winsxs directory.
1 parent b0b4afc commit c17738a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

numpy/distutils/mingw32ccompiler.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ def find_python_dll():
250250
# - in system32,
251251
# - ortherwise (Sxs), I don't know how to get it.
252252
lib_dirs = []
253+
lib_dirs.append(sys.prefix)
253254
lib_dirs.append(os.path.join(sys.prefix, 'lib'))
254255
try:
255256
lib_dirs.append(os.path.join(os.environ['SYSTEMROOT'], 'system32'))
@@ -302,13 +303,16 @@ def generate_def(dll, dfile):
302303

303304
def find_dll(dll_name):
304305

306+
arch = {'AMD64' : 'amd64',
307+
'Intel' : 'x86'}[get_build_architecture()]
308+
305309
def _find_dll_in_winsxs(dll_name):
306310
# Walk through the WinSxS directory to find the dll.
307311
winsxs_path = os.path.join(os.environ['WINDIR'], 'winsxs')
308312
if not os.path.exists(winsxs_path):
309313
return None
310314
for root, dirs, files in os.walk(winsxs_path):
311-
if dll_name in files:
315+
if dll_name in files and arch in root:
312316
return os.path.join(root, dll_name)
313317
return None
314318

0 commit comments

Comments
 (0)
0