Ensure always writing a number to file

This commit is contained in:
2023-08-22 20:25:25 +02:00
parent 12f6d1bf3f
commit 7ac6583796

View File

@@ -38,7 +38,7 @@ def writeAvgSpeedToDisk(speed):
path = os.path.join(pwd, '.avgspeed.txt') path = os.path.join(pwd, '.avgspeed.txt')
with open(path, 'w') as f: with open(path, 'w') as f:
f.write(str(int(speed))) f.write(str(int(speed or 100)))
f.close() f.close()
def readAvgSpeedFromDisk(): def readAvgSpeedFromDisk():