---
 Lib/test/test_socket.py |   21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

Index: Python-3.14.4/Lib/test/test_socket.py
===================================================================
--- Python-3.14.4.orig/Lib/test/test_socket.py	2026-04-27 22:32:58.390808080 +0200
+++ Python-3.14.4/Lib/test/test_socket.py	2026-04-27 22:51:31.284375485 +0200
@@ -168,6 +168,22 @@
     return (cid is not None)
 
 
+def _have_socket_udplite():
+    """Check whether UDPLITE sockets are supported on this host."""
+    if not hasattr(socket, "IPPROTO_UDPLITE"):
+        return False
+    # Older Android versions block UDPLITE with SELinux.
+    if support.is_android and platform.android_ver().api_level < 29:
+        return False
+    try:
+        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDPLITE)
+    except (AttributeError, OSError):
+        return False
+    else:
+        s.close()
+    return True
+
+
 def _have_socket_bluetooth():
     """Check whether AF_BLUETOOTH sockets are supported on this host."""
     try:
@@ -245,10 +261,7 @@
 
 HAVE_SOCKET_VSOCK = _have_socket_vsock()
 
-# Older Android versions block UDPLITE with SELinux.
-HAVE_SOCKET_UDPLITE = (
-    hasattr(socket, "IPPROTO_UDPLITE")
-    and not (support.is_android and platform.android_ver().api_level < 29))
+HAVE_SOCKET_UDPLITE = _have_socket_udplite()
 
 HAVE_SOCKET_BLUETOOTH = _have_socket_bluetooth()
 
