tools (common/files_utils): put extra suffix before file extension
This commit is contained in:
parent
e573f7f627
commit
ef90f2d3f7
1 changed files with 1 additions and 1 deletions
|
|
@ -30,6 +30,6 @@ def get_unique_name(path):
|
|||
ori_path = path = Path(path)
|
||||
idx = 1
|
||||
while path.exists():
|
||||
path = ori_path.with_name(ori_path.name + f"_{idx}")
|
||||
path = ori_path.with_name(f"{ori_path.stem}_{idx}{ori_path.suffix}")
|
||||
idx += 1
|
||||
return path
|
||||
|
|
|
|||
Loading…
Reference in a new issue