From a87c81a64fc0347f2a2624b69f18d257f16dc239 Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Tue, 12 May 2020 01:28:50 -0700 Subject: [PATCH] helpers: remove unnecessary isinstance test --- src/ocrmypdf/helpers.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/ocrmypdf/helpers.py b/src/ocrmypdf/helpers.py index ff4bb13a..964f7670 100644 --- a/src/ocrmypdf/helpers.py +++ b/src/ocrmypdf/helpers.py @@ -144,11 +144,7 @@ def is_file_writable(test_file: os.PathLike): the location is writable. """ try: - if not isinstance(test_file, Path): - p = Path(test_file) - else: - p = test_file - + p = Path(test_file) if p.is_symlink(): p = p.resolve(strict=False)