Skip to content

Commit

Permalink
use os.add_dll_directory instead of ctypes.WinDLL
Browse files Browse the repository at this point in the history
  • Loading branch information
rgommers committed Oct 27, 2024
1 parent b8e04c2 commit 5727c7c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/packages/sharedlib-in-package/mypkg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ def _load_sharedlib():
within wheels. So pre-load it.
"""
if os.name == "nt":
from ctypes import WinDLL
#from ctypes import WinDLL
basedir = os.path.dirname(__file__)
dll_path = os.path.join(basedir, "libexamplelib.dll")
WinDLL(dll_path)
#dll_path = os.path.join(basedir, "libexamplelib.dll")
#WinDLL(dll_path)
print(basedir)
os.add_dll_directory(basedir)


_load_sharedlib()
Expand Down

0 comments on commit 5727c7c

Please sign in to comment.