From be8e0169d49f7a5f618ee4620d387f76af302a93 Mon Sep 17 00:00:00 2001 From: derrod Date: Tue, 21 Apr 2020 20:05:03 +0200 Subject: [PATCH] [downloader] Check if resume file actually exists before trying to delete it --- legendary/downloader/manager.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/legendary/downloader/manager.py b/legendary/downloader/manager.py index 496b2ef..eb923ff 100644 --- a/legendary/downloader/manager.py +++ b/legendary/downloader/manager.py @@ -602,10 +602,11 @@ class DLManager(Process): self.log.warning(f'Thread did not terminate! {repr(t)}') # clean up resume file - try: - os.remove(self.resume_file) - except OSError as e: - self.log.warning(f'Failed to remove resume file: {e!r}') + if self.resume_file: + try: + os.remove(self.resume_file) + except OSError as e: + self.log.warning(f'Failed to remove resume file: {e!r}') # close up shared memory self.shared_memory.close()