Skip to content

Commit 8d4267c

Browse files
committed
[GR-46043] Backport: Add patch for urllib3
PullRequest: graalpython/2777
2 parents 38f09a0 + a0debbe commit 8d4267c

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[[rules]]
2+
# urllib3 has a check that requires that the ssl implementation's name starts with "OpenSSL", we need to patch it out
3+
patch = 'urllib3-2.patch'
4+
subdir = 'src'
5+
# Older versions worked fine before the check was added
6+
version = '>= 2'
7+
install-priority = 0
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/urllib3/__init__.py b/urllib3/__init__.py
2+
index 43e79fa..28c0272 100644
3+
--- a/urllib3/__init__.py
4+
+++ b/urllib3/__init__.py
5+
@@ -29,18 +29,6 @@ try:
6+
import ssl
7+
except ImportError:
8+
pass
9+
-else:
10+
- # fmt: off
11+
- if (
12+
- not ssl.OPENSSL_VERSION.startswith("OpenSSL ")
13+
- or ssl.OPENSSL_VERSION_INFO < (1, 1, 1)
14+
- ): # Defensive:
15+
- raise ImportError(
16+
- "urllib3 v2.0 only supports OpenSSL 1.1.1+, currently "
17+
- f"the 'ssl' module is compiled with {ssl.OPENSSL_VERSION}. "
18+
- "See: https://github.com/urllib3/urllib3/issues/2168"
19+
- )
20+
- # fmt: on
21+
22+
# === NOTE TO REPACKAGERS AND VENDORS ===
23+
# Please delete this block, this logic is only

0 commit comments

Comments
 (0)