ignore ssl only on windows

This commit is contained in:
me-no-dev 2016-10-17 17:08:57 +03:00
parent 0dcf5a49d2
commit 4865ed0d13

View File

@ -66,16 +66,21 @@ def unpack(filename, destination):
shutil.move(dirname, rename_to) shutil.move(dirname, rename_to)
def get_tool(tool): def get_tool(tool):
sys_name = platform.system()
archive_name = tool['archiveFileName'] archive_name = tool['archiveFileName']
local_path = dist_dir + archive_name local_path = dist_dir + archive_name
url = tool['url'] url = tool['url']
#real_hash = tool['checksum'].split(':')[1] #real_hash = tool['checksum'].split(':')[1]
if 'CYGWIN_NT' in sys_name:
ctx = ssl.create_default_context() ctx = ssl.create_default_context()
ctx.check_hostname = False ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE ctx.verify_mode = ssl.CERT_NONE
if not os.path.isfile(local_path): if not os.path.isfile(local_path):
print('Downloading ' + archive_name); print('Downloading ' + archive_name);
if 'CYGWIN_NT' in sys_name:
urlretrieve(url, local_path, report_progress,context=ctx) urlretrieve(url, local_path, report_progress,context=ctx)
else:
urlretrieve(url, local_path, report_progress)
sys.stdout.write("\rDone\n") sys.stdout.write("\rDone\n")
sys.stdout.flush() sys.stdout.flush()
else: else: