From b82e003d6fa293d6862e5e8eb98d0df0ae579548 Mon Sep 17 00:00:00 2001 From: charlie4284 Date: Tue, 4 Jul 2023 22:24:30 +0800 Subject: [PATCH] fix: key error --- src/runner.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/runner.py b/src/runner.py index 24bfe6663..2815b1188 100644 --- a/src/runner.py +++ b/src/runner.py @@ -636,13 +636,13 @@ def _wget_install(self, executables: Iterable[WgetExecutable]) -> None: executable_path = f"/usr/bin/{executable.cmd}" logger.info("Downloading %s via wget to %s...", executable.url, executable_path) wget_cmd = ["/usr/bin/wget", executable.url, "-O", executable_path] - if self.config.proxies["http"] or self.config.proxies["https"]: + if self.config.proxies.get("http", None) or self.config.proxies.get("https", None): wget_cmd += ["-e", "use_proxy=on"] - if self.config.proxies["http"]: + if self.config.proxies.get("http", None): wget_cmd += ["-e", f"http_proxy={self.config.proxies['http']}"] - if self.config.proxies["https"]: + if self.config.proxies.get("https", None): wget_cmd += ["-e", f"https_proxy={self.config.proxies['https']}"] - if self.config.proxies["no_proxy"]: + if self.config.proxies.get("no_proxy", None): wget_cmd += ["-e", f"no_proxy={self.config.proxies['no_proxy']}"] self.instance.execute(wget_cmd) self.instance.execute(["/usr/bin/chmod", "+x", executable_path])