Skip to content

Commit

Permalink
Use pathlib to delete pot. existing data files before creating them.
Browse files Browse the repository at this point in the history
  • Loading branch information
antarcticrainforest committed Sep 27, 2023
1 parent 1cf529e commit 7bd37ca
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions flit/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 201,7 @@ def install_data_dir(self, target_data_dir):
rel_path = os.path.relpath(src_path, self.ini_info.data_directory)
dst_path = os.path.join(target_data_dir, rel_path)
os.makedirs(os.path.dirname(dst_path), exist_ok=True)
if os.path.exists(dst_path):
os.remove(dst_path)
pathlib.Path(dst_path, missing_ok=True)
if self.symlink:
os.symlink(os.path.realpath(src_path), dst_path)
else:
Expand Down

0 comments on commit 7bd37ca

Please sign in to comment.