1
0
mirror of https://github.com/ciromattia/kcc synced 2025-12-30 18:11:49 +00:00

Yet another workaround for file lock problems (#125)

This commit is contained in:
Paweł Jastrzębski
2015-01-24 10:07:27 +01:00
parent c62eeeb712
commit ad3ff35aaa
3 changed files with 19 additions and 6 deletions

View File

@@ -21,6 +21,7 @@ from hashlib import md5
from html.parser import HTMLParser
from distutils.version import StrictVersion
from scandir import walk
from time import sleep
class HTMLStripper(HTMLParser):
@@ -74,6 +75,18 @@ def check7ZFile(filePath):
return header == b"7z\xbc\xaf'\x1c"
def saferReplace(old, new):
for x in range(5):
try:
os.replace(old, new)
except PermissionError:
sleep(5)
else:
break
else:
raise PermissionError
# noinspection PyUnresolvedReferences
def dependencyCheck(level):
missing = []