mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-04-30 16:57:29 -07:00
42 lines
1.7 KiB
Diff
42 lines
1.7 KiB
Diff
From 8d10219036ab18462c0a8e35a5aae80e0d284c57 Mon Sep 17 00:00:00 2001
|
|
From: Steve Kowalik <steven@wedontsleep.org>
|
|
Date: Fri, 10 Apr 2026 11:36:31 +1000
|
|
Subject: [PATCH] Support Python 3.14 partial() changes
|
|
|
|
functools.partial() was changed in Python 3.14 to be a method
|
|
descriptor, which means we need to wrap it in staticmethod now. This
|
|
change does appear to be backward compatible, so I haven't guarded it
|
|
with a version check.
|
|
---
|
|
httpretty/core.py | 6 +++---
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/httpretty/core.py b/httpretty/core.py
|
|
index 69686458..2cea6a89 100644
|
|
--- a/httpretty/core.py
|
|
+++ b/httpretty/core.py
|
|
@@ -1852,7 +1852,7 @@ def apply_patch_socket():
|
|
extract_into_urllib3()
|
|
|
|
if requests_urllib3_connection is not None:
|
|
- urllib3_wrap = partial(fake_wrap_socket, old_requests_ssl_wrap_socket)
|
|
+ urllib3_wrap = staticmethod(partial(fake_wrap_socket, old_requests_ssl_wrap_socket))
|
|
requests_urllib3_connection.ssl_wrap_socket = urllib3_wrap
|
|
requests_urllib3_connection.__dict__['ssl_wrap_socket'] = urllib3_wrap
|
|
|
|
@@ -1867,12 +1867,12 @@ def apply_patch_socket():
|
|
socks.__dict__['socksocket'] = fakesock.socket
|
|
|
|
if ssl:
|
|
- new_wrap = partial(fake_wrap_socket, old_ssl_wrap_socket)
|
|
+ new_wrap = staticmethod(partial(fake_wrap_socket, old_ssl_wrap_socket))
|
|
ssl.wrap_socket = new_wrap
|
|
ssl.SSLSocket = FakeSSLSocket
|
|
ssl.SSLContext = old_sslcontext_class
|
|
try:
|
|
- ssl.SSLContext.wrap_socket = partial(fake_wrap_socket, old_ssl_wrap_socket)
|
|
+ ssl.SSLContext.wrap_socket = staticmethod(partial(fake_wrap_socket, old_ssl_wrap_socket))
|
|
except AttributeError:
|
|
pass
|
|
|