only add dll directory on windows

This commit is contained in:
Concedo 2023-09-13 18:45:54 +08:00
parent 1f20479af3
commit 3d50c6fe0b

View file

@ -167,9 +167,10 @@ def init_library():
abs_path = getabspath() abs_path = getabspath()
#add all potential paths #add all potential paths
os.add_dll_directory(dir_path) if os.name=='nt':
os.add_dll_directory(abs_path) os.add_dll_directory(dir_path)
os.add_dll_directory(os.getcwd()) os.add_dll_directory(abs_path)
os.add_dll_directory(os.getcwd())
handle = ctypes.CDLL(os.path.join(dir_path, libname)) handle = ctypes.CDLL(os.path.join(dir_path, libname))
handle.load_model.argtypes = [load_model_inputs] handle.load_model.argtypes = [load_model_inputs]