From a0de6788a771bf494e945aa3a8ab50dbfdcec353 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 30 Mar 2020 13:40:33 +0200 Subject: [PATCH] Try again from the start upon arbitrary exception Otherwise we'd crash a few lines later since file_new is not assigned yet. Fixes Sentry issue CURA-EA. --- UM/SaveFile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UM/SaveFile.py b/UM/SaveFile.py index a7f2e98fb4..cb77001e53 100644 --- a/UM/SaveFile.py +++ b/UM/SaveFile.py @@ -1,4 +1,4 @@ -# Copyright (c) 2015 Ultimaker B.V. +# Copyright (c) 2020 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. import tempfile @@ -80,6 +80,7 @@ def __exit__(self, exc_type, exc_value, traceback): if self.__max_retries <= 0: raise e self.__max_retries -= 1 + continue if not self._file.closed and os.path.sameopenfile(self._file.fileno(), file_new.fileno()): file_new.close()