Skip to content

Commit

Permalink
Merge pull request #26 from AntheSevenants/master
Browse files Browse the repository at this point in the history
Do not create directory given current directory
  • Loading branch information
oktaal authored Apr 3, 2024
2 parents 46e6592 + 085c4a1 commit 2da75b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions corpus2alpino/targets/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ def __init__(self, output_path: str, merge_files=False) -> None:
self.merge_files = merge_files
if self.merge_files:
# using a single file
makedirs(path.dirname(output_path), exist_ok=True)
self.file = open(output_path, "w", encoding="utf-8")
output_dir = path.dirname(output_path)
if output_dir != "":
makedirs(output_dir, exist_ok=True)
self.file = open(output_path, 'w', encoding='utf-8')
else:
self.file = None # type: ignore

Expand Down

0 comments on commit 2da75b2

Please sign in to comment.