From fa54ea3276cb3a039a3ec6a087a8340f4c9ce8ff Mon Sep 17 00:00:00 2001 From: MrS0m30n3 Date: Sun, 10 Dec 2017 19:12:43 +0200 Subject: [PATCH] downloaders.py: Reset return code to zero when killing child process Fixes: b2fcc5e54661d9c7525d273c036ad5dd4cedf47c Related to: #244 --- youtube_dl_gui/downloaders.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/youtube_dl_gui/downloaders.py b/youtube_dl_gui/downloaders.py index c41e4c6..9f6fd42 100644 --- a/youtube_dl_gui/downloaders.py +++ b/youtube_dl_gui/downloaders.py @@ -211,6 +211,12 @@ class YoutubeDLDownloader(object): # os.killpg is not available on Windows # See: https://bugs.python.org/issue5115 self._proc.kill() + + # When we kill the child process on Windows the return code + # gets set to 1, so we want to reset the return code back to 0 + # in order to avoid creating logging output in the download(...) + # method + self._proc.returncode = 0 else: os.killpg(self._proc.pid, signal.SIGKILL)