Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf7d891c

Browse files
authored
Merge pull request#18230 from meeseeksmachine/auto-backport-of-pr-18225-on-v3.3.x
Backport PR#18225 on branch v3.3.x (Use certifi when downloading bundled build requirements.)
2 parentsc0addc9 +bfc723c commitf7d891c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

‎setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ def build_extensions(self):
275275

276276
python_requires='>={}'.format('.'.join(str(n)forninmin_version)),
277277
setup_requires=[
278+
"certifi>=2020.06.20",
278279
"numpy>=1.15",
279280
],
280281
install_requires=[

‎setupext.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ def _get_hash(data):
4242
returnhasher.hexdigest()
4343

4444

45+
@functools.lru_cache()
46+
def_get_ssl_context():
47+
importcertifi
48+
importssl
49+
returnssl.create_default_context(cafile=certifi.where())
50+
51+
4552
defdownload_or_cache(url,sha):
4653
"""
4754
Get bytes from the given url or local cache.
@@ -73,7 +80,8 @@ def download_or_cache(url, sha):
7380
# default User-Agent, but not (for example) wget; so I don't feel too
7481
# bad passing in an empty User-Agent.
7582
withurllib.request.urlopen(
76-
urllib.request.Request(url,headers={"User-Agent":""}))asreq:
83+
urllib.request.Request(url,headers={"User-Agent":""}),
84+
context=_get_ssl_context())asreq:
7785
data=req.read()
7886

7987
file_sha=_get_hash(data)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp