mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 20:40:11 +01:00
Switch to requests for downloading tools, and other cleanup.
This commit is contained in:
22
build.py
22
build.py
@@ -27,15 +27,6 @@ import tarfile
|
||||
import tempfile
|
||||
import datetime
|
||||
|
||||
# which version of Python is running this script
|
||||
PY2 = sys.version_info[0] == 2
|
||||
PY3 = sys.version_info[0] == 3
|
||||
|
||||
if PY2:
|
||||
from urllib2 import urlopen
|
||||
else:
|
||||
from urllib.request import urlopen
|
||||
|
||||
from distutils.dep_util import newer, newer_group
|
||||
from buildtools.config import Config, msg, opj, posixjoin, loadETG, etg2sip, findCmd, \
|
||||
phoenixDir, wxDir, copyIfNewer, copyFile, \
|
||||
@@ -46,6 +37,11 @@ from buildtools.config import Config, msg, opj, posixjoin, loadETG, etg2sip, fi
|
||||
import buildtools.version as version
|
||||
|
||||
|
||||
# which version of Python is running this script
|
||||
PY2 = sys.version_info[0] == 2
|
||||
PY3 = sys.version_info[0] == 3
|
||||
|
||||
|
||||
# defaults
|
||||
PYVER = '2.7'
|
||||
PYSHORTVER = '27'
|
||||
@@ -91,7 +87,7 @@ doxygenMD5 = {
|
||||
}
|
||||
|
||||
# And the location where they can be downloaded from
|
||||
toolsURL = 'http://wxpython.org/Phoenix/tools'
|
||||
toolsURL = 'https://wxpython.org/Phoenix/tools'
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -560,9 +556,11 @@ def getTool(cmdName, version, MD5, envVar, platformBinary, linuxBits=False):
|
||||
msg('Not found. Attempting to download...')
|
||||
url = '%s/%s.bz2' % (toolsURL, os.path.basename(cmd))
|
||||
try:
|
||||
connection = urlopen(url)
|
||||
import requests
|
||||
resp = requests.get(url)
|
||||
resp.raise_for_status()
|
||||
msg('Connection successful...')
|
||||
data = connection.read()
|
||||
data = resp.content
|
||||
msg('Data downloaded...')
|
||||
except Exception:
|
||||
_error_msg('Unable to download ' + url)
|
||||
|
||||
Reference in New Issue
Block a user