Skip to content

Commit

Permalink
move second check if path exist one indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mKlapwijk committed Aug 14, 2024
1 parent 36633f1 commit f3e764a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions decoimpact/data/entities/data_access_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ def write_output_file(
# try to make intermediate folders
Path(path.parent).mkdir(parents=True, exist_ok=True)

if not Path.exists(path.parent):
message = f"""The path {path.parent} is not found. \
Make sure the output file location is valid."""
raise FileExistsError(message)
if not Path.exists(path.parent):
message = f"""The path {path.parent} is not found. \
Make sure the output file location is valid."""
raise FileExistsError(message)

if Path(path).suffix != ".nc":
message = f"""The file {path} is not supported. \
Expand Down

0 comments on commit f3e764a

Please sign in to comment.