Skip to content

Commit 2b9d33e

Browse files
Merge pull request #617 from insertinterestingnamehere/dll_load_logic
Dll load logic
2 parents c591a5c + 66e4e34 commit 2b9d33e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

dynd/__init__.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
try:
99
# The default dll search order should give precedence to copies of
1010
# libdynd in the same directory as this file.
11+
cdll.LoadLibrary('libdyndt.dll')
1112
cdll.LoadLibrary('libdynd.dll')
1213
except OSError:
1314
# Try to load it from the Program Files directories where libdynd
@@ -35,18 +36,14 @@
3536
prog_files = os.environ.get('ProgramFiles')
3637
if prog_files is None:
3738
raise RuntimeError(err_str.format('ProgramFiles'))
38-
libdynd_path = os.path.join(prog_files, 'libdynd', 'lib',
39-
'libdynd.dll')
40-
if os.path.isfile(libdynd_path):
41-
cdll.LoadLibrary(libdynd_path)
4239
else:
4340
prog_files = os.environ.get('ProgramFiles(x86)')
4441
if prog_files is None:
4542
raise RuntimeError(err_str.format('ProgramFiles(x86)'))
46-
libdynd_path = os.path.join(prog_files, 'libdynd', 'lib',
47-
'libdynd.dll')
48-
if os.path.isfile(libdynd_path):
49-
cdll.LoadLibrary(libdynd_path)
43+
dynd_lib_dir = os.path.join(prog_files, 'libdynd', 'lib')
44+
if os.path.isdir(dynd_lib_dir):
45+
cdll.LoadLibrary(os.path.join(dynd_lib_dir, 'libdyndt.dll'))
46+
cdll.LoadLibrary(os.path.join(dynd_lib_dir, 'libdynd.dll'))
5047

5148
from .config import _dynd_version_string as __libdynd_version__, \
5249
_dynd_python_version_string as __version__, \

0 commit comments

Comments
 (0)