diff sat/tools/common/files_utils.py @ 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 2e1c3d33099b
children 9d0df638c8b4
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}")