raise error if passed base is not a zipfile or dir
This commit is contained in:
parent
e065145162
commit
f076263993
2 changed files with 15 additions and 1 deletions
|
@ -118,6 +118,10 @@ def match_structure(
|
|||
zf = zipfile.ZipFile(base)
|
||||
zf.extractall(path=sd)
|
||||
|
||||
else:
|
||||
if not searchdir.is_dir():
|
||||
raise NotADirectoryError(f"Expected either a zipfile or a directory, received {searchdir}")
|
||||
|
||||
matches: List[Path] = []
|
||||
possible_targets: List[Path] = [searchdir]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue