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

This commit is contained in:
Jiaming Yuan
2023-12-13 14:20:30 +08:00
committed by GitHub
parent e4ee4e79dc
commit d2d1751c03

View File

@@ -206,6 +206,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