MCPcopy Create free account
hub / github.com/numpy/numpy / find_dll

Function find_dll

numpy/distutils/mingw32ccompiler.py:256–280  ·  view source on GitHub ↗
(dll_name)

Source from the content-addressed store, hash-verified

254 d.write('%s\n' % s[1])
255
256def find_dll(dll_name):
257
258 arch = {'AMD64' : 'amd64',
259 'Intel' : 'x86'}[get_build_architecture()]
260
261 def _find_dll_in_winsxs(dll_name):
262 # Walk through the WinSxS directory to find the dll.
263 winsxs_path = os.path.join(os.environ.get('WINDIR', r'C:\WINDOWS'),
264 'winsxs')
265 if not os.path.exists(winsxs_path):
266 return None
267 for root, dirs, files in os.walk(winsxs_path):
268 if dll_name in files and arch in root:
269 return os.path.join(root, dll_name)
270 return None
271
272 def _find_dll_in_path(dll_name):
273 # First, look in the Python directory, then scan PATH for
274 # the given dll name.
275 for path in [sys.prefix] + os.environ['PATH'].split(';'):
276 filepath = os.path.join(path, dll_name)
277 if os.path.exists(filepath):
278 return os.path.abspath(filepath)
279
280 return _find_dll_in_winsxs(dll_name) or _find_dll_in_path(dll_name)
281
282def build_msvcr_library(debug=False):
283 if os.name != 'nt':

Callers 1

build_msvcr_libraryFunction · 0.85

Calls 3

get_build_architectureFunction · 0.90
_find_dll_in_winsxsFunction · 0.85
_find_dll_in_pathFunction · 0.85

Tested by

no test coverage detected