Skip to content

Commit

Permalink
Try again from the start upon arbitrary exception
Browse files Browse the repository at this point in the history
Otherwise we'd crash a few lines later since file_new is not assigned yet.

Fixes Sentry issue CURA-EA.
  • Loading branch information
Ghostkeeper committed Mar 30, 2020
1 parent acc7578 commit a0de678
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion UM/SaveFile.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit a0de678

Please sign in to comment.