From 29c19d1337dc6f86a2197ebd98c19b93a3d6184b Mon Sep 17 00:00:00 2001 From: Joey Payne Date: Wed, 3 Jun 2015 16:25:24 -0600 Subject: [PATCH] Unverified context doesn't work on all versions of Python. Removed it. --- command_line.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/command_line.py b/command_line.py index a5c7db3..c0106a3 100644 --- a/command_line.py +++ b/command_line.py @@ -25,7 +25,6 @@ import logging import logging.handlers as lh import plistlib import codecs -import ssl from utils import get_data_path, get_data_file_path @@ -43,8 +42,6 @@ from configobj import ConfigObj inside_packed_exe = getattr(sys, 'frozen', '') -URL_CONTEXT = ssl._create_unverified_context() - CWD = os.getcwd() def get_file(path): @@ -366,7 +363,7 @@ class CommandBase(object): def get_versions(self): if self.logger is not None: self.logger.info('Getting versions...') - response = urllib2.urlopen(self.settings['version_info']['url'], context=URL_CONTEXT) + response = urllib2.urlopen(self.settings['version_info']['url']) html = response.read() nw_version = self.get_setting('nw_version') @@ -891,7 +888,7 @@ class CommandBase(object): headers = {'Range': 'bytes={}-'.format(tmp_size)} url = urllib2.Request(url, headers=headers) - web_file = urllib2.urlopen(url, URL_CONTEXT) + web_file = urllib2.urlopen(url) f = open(tmp_file, 'ab') meta = web_file.info() file_size = tmp_size + int(meta.getheaders("Content-Length")[0])