diff --git a/comicapi/archivers/folder.py b/comicapi/archivers/folder.py index c0292dc..ec94a3a 100644 --- a/comicapi/archivers/folder.py +++ b/comicapi/archivers/folder.py @@ -93,5 +93,5 @@ class FolderArchiver(Archiver): return "Folder" @classmethod - def is_valid(cls, path: pathlib.Path | str) -> bool: - return os.path.isdir(path) + def is_valid(cls, path: pathlib.Path) -> bool: + return path.is_dir() diff --git a/comicapi/archivers/rar.py b/comicapi/archivers/rar.py index 84537ae..96cbff9 100644 --- a/comicapi/archivers/rar.py +++ b/comicapi/archivers/rar.py @@ -246,7 +246,7 @@ class RarArchiver(Archiver): return "RAR" @classmethod - def is_valid(cls, path: pathlib.Path | str) -> bool: + def is_valid(cls, path: pathlib.Path) -> bool: if rar_support: return rarfile.is_rarfile(str(path)) return False diff --git a/comicapi/archivers/sevenzip.py b/comicapi/archivers/sevenzip.py index a8b574c..be6e059 100644 --- a/comicapi/archivers/sevenzip.py +++ b/comicapi/archivers/sevenzip.py @@ -127,5 +127,5 @@ class SevenZipArchiver(Archiver): return "Seven Zip" @classmethod - def is_valid(cls, path: pathlib.Path | str) -> bool: + def is_valid(cls, path: pathlib.Path) -> bool: return py7zr.is_7zfile(path) diff --git a/comicapi/archivers/zip.py b/comicapi/archivers/zip.py index 0ab8941..afc7ffa 100644 --- a/comicapi/archivers/zip.py +++ b/comicapi/archivers/zip.py @@ -129,7 +129,7 @@ class ZipArchiver(Archiver): return "ZIP" @classmethod - def is_valid(cls, path: pathlib.Path | str) -> bool: + def is_valid(cls, path: pathlib.Path) -> bool: return zipfile.is_zipfile(path) def write_zip_comment(self, filename: pathlib.Path | str, comment: str) -> bool: