Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions openslide/lowlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ def _load_library() -> CDLL:
pass

def try_load(names: list[str]) -> CDLL:
error_strings = []
for name in names:
try:
return cdll.LoadLibrary(name)
except OSError:
except OSError as err:
error_strings.append(f"{name}: {err}")
if name == names[-1]:
raise
raise OSError("\n".join(error_strings))
else:
raise ValueError('No library names specified')

Expand Down
Loading