Added prevention for rare error

This commit is contained in:
Fierelier 2019-01-07 00:20:17 +01:00
parent e803811cd8
commit 5c95a87df5

View File

@ -188,7 +188,17 @@ def unloadMods(output = False):
if output: print("Can't delete folder! Is it in use?")
return
os.rename(originalAppPath,appPath)
tries = 0
while tries < 100:
try:
os.rename(originalAppPath,appPath)
tries + 1
except:
time.sleep(0.1)
else:
tries = 10
#ctypes.windll.kernel32.SetFileAttributesW(appPath,128)
if output: print("\nUnloading mods successful.")