Skip to content

Commit

Permalink
fix minor code smell
Browse files Browse the repository at this point in the history
Signed-off-by: Martijn Govers <Martijn.Govers@Alliander.com>
  • Loading branch information
mgovers committed Oct 10, 2023
1 parent a1d989d commit 88b52c1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/power_grid_model_io/utils/zip.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ def extract(src_file_path: Path, dst_dir_path: Optional[Path] = None, skip_if_ex

log = _log.bind(src_file_path=src_file_path, dst_dir_path=dst_dir_path)

if dst_dir_path.exists():
if not dst_dir_path.is_dir():
raise NotADirectoryError(f"Destination dir {dst_dir_path} exists and is not a directory")
if dst_dir_path.exists() and not dst_dir_path.is_dir():
raise NotADirectoryError(f"Destination dir {dst_dir_path} exists and is not a directory")

# Create the destination directory
dst_dir_path.mkdir(parents=True, exist_ok=True)
Expand Down

0 comments on commit 88b52c1

Please sign in to comment.