File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -44,15 +44,17 @@ def _load_shared_library(lib_base_name: str):
4444 _base_path = _lib .parent .resolve ()
4545 _lib_paths = [_lib .resolve ()]
4646
47+ cdll_args = dict () # type: ignore
4748 # Add the library directory to the DLL search path on Windows (if needed)
4849 if sys .platform == "win32" and sys .version_info >= (3 , 8 ):
4950 os .add_dll_directory (str (_base_path ))
51+ cdll_args ["winmode" ] = 0
5052
5153 # Try to load the shared library, handling potential errors
5254 for _lib_path in _lib_paths :
5355 if _lib_path .exists ():
5456 try :
55- return ctypes .CDLL (str (_lib_path ), winmode = 0 )
57+ return ctypes .CDLL (str (_lib_path ), ** cdll_args )
5658 except Exception as e :
5759 raise RuntimeError (f"Failed to load shared library '{ _lib_path } ': { e } " )
5860
You can’t perform that action at this time.
0 commit comments