mirror of
https://github.com/ciromattia/kcc
synced 2025-12-12 17:26:23 +00:00
rmtree ignores errors
This commit is contained in:
@@ -464,7 +464,7 @@ class WorkerThread(QThread):
|
|||||||
if os.path.isfile(path):
|
if os.path.isfile(path):
|
||||||
os.remove(path)
|
os.remove(path)
|
||||||
elif os.path.isdir(path):
|
elif os.path.isdir(path):
|
||||||
rmtree(path)
|
rmtree(path, True)
|
||||||
GUI.progress.content = ''
|
GUI.progress.content = ''
|
||||||
GUI.progress.stop()
|
GUI.progress.stop()
|
||||||
MW.hideProgressBar.emit()
|
MW.hideProgressBar.emit()
|
||||||
|
|||||||
@@ -1573,7 +1573,7 @@ def makeBook(source, qtgui=None):
|
|||||||
if os.path.isfile(source):
|
if os.path.isfile(source):
|
||||||
os.remove(source)
|
os.remove(source)
|
||||||
elif os.path.isdir(source):
|
elif os.path.isdir(source):
|
||||||
rmtree(source)
|
rmtree(source, True)
|
||||||
|
|
||||||
end = perf_counter()
|
end = perf_counter()
|
||||||
print(f"makeBook: {end - start} seconds")
|
print(f"makeBook: {end - start} seconds")
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ def main(argv=None, qtgui=None):
|
|||||||
raise RuntimeError("One of workers crashed. Cause: " + splitWorkerOutput[0][0],
|
raise RuntimeError("One of workers crashed. Cause: " + splitWorkerOutput[0][0],
|
||||||
splitWorkerOutput[0][1])
|
splitWorkerOutput[0][1])
|
||||||
if args.inPlace:
|
if args.inPlace:
|
||||||
rmtree(sourceDir)
|
rmtree(sourceDir, True)
|
||||||
move(targetDir, sourceDir)
|
move(targetDir, sourceDir)
|
||||||
else:
|
else:
|
||||||
rmtree(targetDir, True)
|
rmtree(targetDir, True)
|
||||||
|
|||||||
@@ -123,4 +123,4 @@ class MetadataParser:
|
|||||||
cbx.addFile(tmpXML)
|
cbx.addFile(tmpXML)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise UserWarning(e)
|
raise UserWarning(e)
|
||||||
rmtree(workdir)
|
rmtree(workdir, True)
|
||||||
|
|||||||
Reference in New Issue
Block a user