Skip to content

Commit

Permalink
Only remove existing files and exit gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
Fittiboy committed Jul 1, 2021
1 parent 3fca6b4 commit 4d471f1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions clipper.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,10 @@ def dl_progress(count, block_size, total_size):
upload.Upload()
remove(fullpath)
print()
except KeyboardInterrupt as e:
remove(fullpath)
raise e
except KeyboardInterrupt:
if isfile(fullpath):
remove(fullpath)
sys.exit("Exiting...")
except Exception as e:
failed += 1
print(e)
Expand Down

0 comments on commit 4d471f1

Please sign in to comment.