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:
@@ -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 = []
|
||||
|
||||
Reference in New Issue
Block a user