1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-06 13:17:44 +03:00

ukify: Handle directories in path_is_readable()

This commit is contained in:
Daan De Meyer 2023-01-02 14:52:49 +01:00
parent 8d885b4477
commit 737dab1a8d

View File

@ -69,7 +69,10 @@ def path_is_readable(s: str | None) -> pathlib.Path | None:
if s is None:
return None
p = pathlib.Path(s)
p.open().close()
try:
p.open().close()
except IsADirectoryError:
pass
return p