[py] Use the first found native library. (#9860)

This commit is contained in:
Jiaming Yuan 2023-12-08 17:23:16 +08:00 committed by GitHub
parent 42de9206fc
commit 1094d6015d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -211,6 +211,7 @@ def _load_lib() -> ctypes.CDLL:
lib = ctypes.cdll.LoadLibrary(lib_path)
setattr(lib, "path", os.path.normpath(lib_path))
lib_success = True
break
except OSError as e:
os_error_list.append(str(e))
continue