From 737dab1a8d7d1d667f92f1572d47ab3776a30cdb Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Mon, 2 Jan 2023 14:52:49 +0100 Subject: [PATCH] ukify: Handle directories in path_is_readable() --- src/ukify/ukify.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ukify/ukify.py b/src/ukify/ukify.py index ad2f8a2c71..e1ee7106c1 100755 --- a/src/ukify/ukify.py +++ b/src/ukify/ukify.py @@ -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