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:
2Shirt 2019-09-22 23:31:15 -07:00
parent 60969f26eb
commit ff1044a401
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -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