mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 02:45:55 +08:00
Protect against crashes when the temporary file is still in use by
another process. Contributes to CURA-5516.
This commit is contained in:
parent
c25a733768
commit
6737dfac47
@ -330,7 +330,10 @@ class CuraPackageManager(QObject):
|
|||||||
self.__installPackageFiles(package_id, src_dir_path, dst_dir_path)
|
self.__installPackageFiles(package_id, src_dir_path, dst_dir_path)
|
||||||
|
|
||||||
# Remove the file
|
# Remove the file
|
||||||
os.remove(filename)
|
try:
|
||||||
|
os.remove(filename)
|
||||||
|
except Exception:
|
||||||
|
Logger.log("w", "Tried to delete file [%s], but it failed", filename)
|
||||||
# Move the info to the installed list of packages only when it succeeds
|
# Move the info to the installed list of packages only when it succeeds
|
||||||
self._installed_package_dict[package_id] = self._to_install_package_dict[package_id]
|
self._installed_package_dict[package_id] = self._to_install_package_dict[package_id]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user