Fix error when dealing with filename collision
This commit is contained in:
parent
d3683c7028
commit
a7f6451921
2
utils.py
2
utils.py
|
@ -33,7 +33,7 @@ def get_name_from_title(title):
|
|||
n = 1
|
||||
while os.path.exists(os.path.join(shipdir,t+str(n)+".txt")):
|
||||
n+=1
|
||||
return os.path.join(shipdir,t+str(num)+".txt")
|
||||
return os.path.join(shipdir,t+str(n)+".txt")
|
||||
else: return os.path.join(shipdir,t+".txt")
|
||||
|
||||
def write_file(filename,text):
|
||||
|
|
Loading…
Reference in New Issue