From 6144aab35345788bc0b004e58fcde1d559a4cdda Mon Sep 17 00:00:00 2001 From: Caohongtao Date: Wed, 30 Aug 2023 03:29:35 +0000 Subject: [PATCH] update src/downloadService.py. Signed-off-by: Caohongtao --- src/downloadService.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/downloadService.py b/src/downloadService.py index ccf957f..c43ff82 100644 --- a/src/downloadService.py +++ b/src/downloadService.py @@ -64,9 +64,9 @@ yum makecache continue download_url = self.gen_wget_url(self.download_path, url, filename) self.tool.prt_content("DOWNLOAD " + filename) - output = os.popen(download_url) - data = output.read() - output.close() + with os.popen(download_url) as p: + data = p.read() + if not download_flag: print("The download list is empty!") -- Gitee