Fix typing

This commit is contained in:
Timmy Welch 2023-01-20 19:32:06 -08:00
parent f6698f7f0a
commit 2de241cdd5
No known key found for this signature in database
4 changed files with 5 additions and 5 deletions

View File

@ -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()

View File

@ -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

View File

@ -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)

View File

@ -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: