changeset 3131:d6da17f6e4ce

tools (common/files_utils): fixed get_unique_name when `path` is a str and not a Path
author Goffi <goffi@goffi.org>
date Mon, 27 Jan 2020 19:53:31 +0100
parents b9486a7f9b4f
children b64dd7c1496d
files sat/tools/common/files_utils.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sat/tools/common/files_utils.py	Mon Jan 27 19:53:31 2020 +0100
+++ b/sat/tools/common/files_utils.py	Mon Jan 27 19:53:31 2020 +0100
@@ -27,7 +27,7 @@
     @param path(str, Path): path to the file to create
     @return (Path): unique path (can be the same as path if there is no conflict)
     """
-    ori_path = Path(path)
+    ori_path = path = Path(path)
     idx = 1
     while path.exists():
         path = ori_path.with_name(ori_path.name  + f"_{idx}")