aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/util.py
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2023-07-27 17:26:22 +0200
committerGitHub <noreply@github.com>2023-07-27 15:26:22 +0000
commit17a5b9200d09e50850155c71919b99bf8e322798 (patch)
treea0c7bc2a8ec08087d063d7a8a8a6adb1a55d2e5a /python/servo/util.py
parentb8c04b4bad1636f78cddf8ec1944386520600da0 (diff)
downloadservo-17a5b9200d09e50850155c71919b99bf8e322798.tar.gz
servo-17a5b9200d09e50850155c71919b99bf8e322798.zip
Remove old code for out-of-date CA stores (#30031)
This code was written to handle both Python 2 (which we no longer support) and old Windows CI machines that did not have up-to-date CA stores. I think we can remove this now.
Diffstat (limited to 'python/servo/util.py')
-rw-r--r--python/servo/util.py23
1 files changed, 1 insertions, 22 deletions
diff --git a/python/servo/util.py b/python/servo/util.py
index 43769e181de..fb1efcf382d 100644
--- a/python/servo/util.py
+++ b/python/servo/util.py
@@ -25,29 +25,8 @@ import six
from io import BufferedIOBase, BytesIO
from socket import error as socket_error
-try:
- from ssl import HAS_SNI
-except ImportError:
- HAS_SNI = False
-
SCRIPT_PATH = os.path.abspath(os.path.dirname(__file__))
SERVO_ROOT = os.path.abspath(os.path.join(SCRIPT_PATH, "..", ".."))
-HAS_SNI_AND_RECENT_PYTHON = HAS_SNI and sys.version_info >= (2, 7, 9)
-
-
-def get_static_rust_lang_org_dist():
- if HAS_SNI_AND_RECENT_PYTHON:
- return "https://static.rust-lang.org/dist"
-
- return "https://static-rust-lang-org.s3.amazonaws.com/dist"
-
-
-def get_urlopen_kwargs():
- # The cafile parameter was added in 2.7.9
- if HAS_SNI_AND_RECENT_PYTHON:
- import certifi
- return {"cafile": certifi.where()}
- return {}
def remove_readonly(func, path, _):
@@ -74,7 +53,7 @@ def download(description: str, url: str, writer: BufferedIOBase, start_byte: int
req = urllib.request.Request(url)
if start_byte:
req = urllib.request.Request(url, headers={'Range': 'bytes={}-'.format(start_byte)})
- resp = urllib.request.urlopen(req, **get_urlopen_kwargs())
+ resp = urllib.request.urlopen(req)
fsize = None
if resp.info().get('Content-Length'):