Fixed logic error in non_clobber_path()
* Before the '_1000' path would be returned incorrectly * If a non-existant path wasn't found that is
This commit is contained in:
parent
60969f26eb
commit
ff1044a401
1 changed files with 3 additions and 2 deletions
|
|
@ -78,8 +78,9 @@ def non_clobber_path(path):
|
||||||
|
|
||||||
# Find non-existant path
|
# Find non-existant path
|
||||||
for _i in range(1000):
|
for _i in range(1000):
|
||||||
new_path = path.with_name(f'{name}_{_i}').with_suffix(suffix)
|
test_path = path.with_name(f'{name}_{_i}').with_suffix(suffix)
|
||||||
if not new_path.exists():
|
if not test_path.exists():
|
||||||
|
new_path = test_path
|
||||||
break
|
break
|
||||||
|
|
||||||
# Raise error if viable path not found
|
# Raise error if viable path not found
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue