Skip to content

Commit

Permalink
Fix path conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
louislefevre committed Apr 16, 2021
1 parent 6b8c3fb commit 3dc343b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion retrieval/util/FileManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def read_tsv(file_name: str) -> Union[list, str]:

def write_txt(file_name: str, data: str, mode='w'):
directory = os.path.dirname(file_name)
if directory and os.path.exists(directory):
if directory and not os.path.exists(directory):
os.makedirs(directory)
file = open(file_name, mode=mode)
file.write(data)
Expand Down

0 comments on commit 3dc343b

Please sign in to comment.