File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 2929"""
3030
3131import argparse
32+ import certifi
3233import contextlib
3334import csv
3435import json
3536import os
3637import shlex
37- import ssl
3838import subprocess # nosec B404 # disable import-subprocess check
3939import sys
4040import tempfile
@@ -241,11 +241,9 @@ def main():
241241
242242 print (f"{ len (demos_to_test )} demos will be tested:" )
243243 print (* [demo .subdirectory for demo in demos_to_test ], sep = ',' )
244-
245- no_verify_because_of_windows = ssl .create_default_context ()
246- no_verify_because_of_windows .check_hostname = False
247- no_verify_because_of_windows .verify_mode = ssl .CERT_NONE
248- with urlopen (COCO128_URL , context = no_verify_because_of_windows ) as zipresp : # nosec B310 # disable urllib_urlopen because url is hardcoded
244+ os .environ ["REQUESTS_CA_BUNDLE" ] = certifi .where ()
245+ os .environ ["SSL_CERT_FILE" ] = certifi .where ()
246+ with urlopen (COCO128_URL ) as zipresp : # nosec B310 # disable urllib_urlopen because url is hardcoded
249247 with ZipFile (BytesIO (zipresp .read ())) as zfile :
250248 zfile .extractall (args .test_data_dir )
251249
You can’t perform that action at this time.
0 commit comments