Compare commits

..

No commits in common. "9a4fb87d44065223522947698abcba4f398731be" and "c1ce90d1ce101fe6cf323ea377d5745fad2afe21" have entirely different histories.

1 changed files with 7 additions and 5 deletions

View File

@ -122,18 +122,20 @@ def main() -> None:
try:
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
except urllib.error.URLError:
try:
import certifi
import ssl
except:
print("\"certifi\" module not found. Please install it using \"python -m pip install certifi\".")
return
import sys
import subprocess
curr_py = sys.executable
subprocess.check_call([curr_py, '-m', 'pip', 'install', 'certifi', 'ssl'], stdout=subprocess.DEVNULL)
with urllib.request.urlopen(req, context=ssl.create_default_context(cafile=certifi.where())) as response:
download(url, response, output)
if __name__ == "__main__":
main()