Unverified context doesn't work on all versions of Python. Removed it.
This commit is contained in:
parent
97b3bc74a3
commit
29c19d1337
1 changed files with 2 additions and 5 deletions
|
|
@ -25,7 +25,6 @@ import logging
|
||||||
import logging.handlers as lh
|
import logging.handlers as lh
|
||||||
import plistlib
|
import plistlib
|
||||||
import codecs
|
import codecs
|
||||||
import ssl
|
|
||||||
|
|
||||||
from utils import get_data_path, get_data_file_path
|
from utils import get_data_path, get_data_file_path
|
||||||
|
|
||||||
|
|
@ -43,8 +42,6 @@ from configobj import ConfigObj
|
||||||
|
|
||||||
inside_packed_exe = getattr(sys, 'frozen', '')
|
inside_packed_exe = getattr(sys, 'frozen', '')
|
||||||
|
|
||||||
URL_CONTEXT = ssl._create_unverified_context()
|
|
||||||
|
|
||||||
CWD = os.getcwd()
|
CWD = os.getcwd()
|
||||||
|
|
||||||
def get_file(path):
|
def get_file(path):
|
||||||
|
|
@ -366,7 +363,7 @@ class CommandBase(object):
|
||||||
def get_versions(self):
|
def get_versions(self):
|
||||||
if self.logger is not None:
|
if self.logger is not None:
|
||||||
self.logger.info('Getting versions...')
|
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()
|
html = response.read()
|
||||||
|
|
||||||
nw_version = self.get_setting('nw_version')
|
nw_version = self.get_setting('nw_version')
|
||||||
|
|
@ -891,7 +888,7 @@ class CommandBase(object):
|
||||||
headers = {'Range': 'bytes={}-'.format(tmp_size)}
|
headers = {'Range': 'bytes={}-'.format(tmp_size)}
|
||||||
url = urllib2.Request(url, headers=headers)
|
url = urllib2.Request(url, headers=headers)
|
||||||
|
|
||||||
web_file = urllib2.urlopen(url, URL_CONTEXT)
|
web_file = urllib2.urlopen(url)
|
||||||
f = open(tmp_file, 'ab')
|
f = open(tmp_file, 'ab')
|
||||||
meta = web_file.info()
|
meta = web_file.info()
|
||||||
file_size = tmp_size + int(meta.getheaders("Content-Length")[0])
|
file_size = tmp_size + int(meta.getheaders("Content-Length")[0])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue