Skip to content

Commit

Permalink
image renaming hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
baskiton committed May 1, 2024
1 parent dab4614 commit aad58eb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions SatsDecoder/systems/image_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ def rename(self, new_filename):
self.close()
old = self.fn
new_filename = self.fn.with_name(new_filename)
try:
self.fn.rename(new_filename)
except FileExistsError:
self.fn.unlink(True)
for i in range(2):
try:
self.fn.rename(new_filename)
break
except FileExistsError:
new_filename.unlink(True)
self.fn = new_filename
self.renamed = old

Expand Down

0 comments on commit aad58eb

Please sign in to comment.