From 9a4fb87d44065223522947698abcba4f398731be Mon Sep 17 00:00:00 2001 From: CreateSource <72283721+abnormalhare@users.noreply.github.com> Date: Sat, 23 Nov 2024 14:11:44 -0500 Subject: [PATCH] Determine type of URLError --- tools/download_tool.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/download_tool.py b/tools/download_tool.py index b15d238..27312c6 100644 --- a/tools/download_tool.py +++ b/tools/download_tool.py @@ -123,6 +123,8 @@ def main() -> None: with urllib.request.urlopen(req) as response: download(url, response, output) except urllib.error.URLError as e: + if str(e).find("CERTIFICATE_VERIFY_FAILED") == -1: + return try: import certifi import ssl @@ -133,6 +135,5 @@ def main() -> None: with urllib.request.urlopen(req, context=ssl.create_default_context(cafile=certifi.where())) as response: download(url, response, output) - if __name__ == "__main__": main()