Skip to content

Commit 66e4e34

Browse files
Make sure that libdyndt.dll is loaded before libdynd in in the custom
loading logic for Windows.
1 parent 35714c6 commit 66e4e34

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

dynd/__init__.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,14 @@
3636
prog_files = os.environ.get('ProgramFiles')
3737
if prog_files is None:
3838
raise RuntimeError(err_str.format('ProgramFiles'))
39-
libdynd_path = os.path.join(prog_files, 'libdynd', 'lib',
40-
'libdynd.dll')
41-
if os.path.isfile(libdynd_path):
42-
cdll.LoadLibrary(libdynd_path)
4339
else:
4440
prog_files = os.environ.get('ProgramFiles(x86)')
4541
if prog_files is None:
4642
raise RuntimeError(err_str.format('ProgramFiles(x86)'))
47-
libdynd_path = os.path.join(prog_files, 'libdynd', 'lib',
48-
'libdynd.dll')
49-
if os.path.isfile(libdynd_path):
50-
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'))
5147

5248
from .config import _dynd_version_string as __libdynd_version__, \
5349
_dynd_python_version_string as __version__, \

0 commit comments

Comments
 (0)