raise error if passed base is not a zipfile or dir

This commit is contained in:
Sean Breckenridge 2021-07-01 06:55:41 -07:00
parent e065145162
commit f076263993
2 changed files with 15 additions and 1 deletions

View file

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