Added prevention for rare error
This commit is contained in:
parent
e803811cd8
commit
5c95a87df5
@ -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.")
|
||||
|
Loading…
Reference in New Issue
Block a user