Skip to content

Commit

Permalink
tests: fix "4 custom target depends extmodule" with Python 3.8+ on Wi…
Browse files Browse the repository at this point in the history
…ndows

Since CPython 3.8 .pyd files no longer look in PATH for loading libraries,
but require the DLL directory to be explicitely added via os.add_dll_directory().
This resulted in those tests failing with 3.8+ on Windows.

Add the DLL build directory with os.add_dll_directory() to fix them.

This was never noticed in CI because it only uses Python 3.7 and the
MSYS2 CPython still used the old behaviour until now.
  • Loading branch information
lazka authored and nirbheek committed Sep 28, 2023
1 parent e77edf4 commit 8b09ab2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
if list(filedir.glob('ext/*tachyon*')):
sys.path.insert(0, (filedir / 'ext').as_posix())

if hasattr(os, 'add_dll_directory'):
os.add_dll_directory(filedir / 'ext' / 'lib')

import tachyon

parser = argparse.ArgumentParser()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
if list(filedir.glob('ext/*tachyon.*')):
sys.path.insert(0, (filedir / 'ext').as_posix())

if hasattr(os, 'add_dll_directory'):
os.add_dll_directory(filedir / 'ext' / 'lib')

import tachyon

parser = argparse.ArgumentParser()
Expand Down

0 comments on commit 8b09ab2

Please sign in to comment.