summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-12-02 15:51:50 (GMT)
committerGitHub <noreply@github.com>2024-12-02 15:51:50 (GMT)
commitc46acd3588864e97d0e0fe37a41aa5e94ac7af51 (patch)
treebfce6eb1884cbfc2a7b551cc26f9b1bc0b67dae8 /Lib/test
parent7c2bd9b2266665ff4010b6c6c175bab18e08e4f8 (diff)
downloadcpython-c46acd3588864e97d0e0fe37a41aa5e94ac7af51.zip
cpython-c46acd3588864e97d0e0fe37a41aa5e94ac7af51.tar.gz
cpython-c46acd3588864e97d0e0fe37a41aa5e94ac7af51.tar.bz2
gh-126876: Fix test_socket.testLargeTimeout() for missing _testcapi (#127517)
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_socket.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 7b3914f..307d6e8 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -5136,7 +5136,10 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
# gh-126876: Check that a timeout larger than INT_MAX is replaced with
# INT_MAX in the poll() code path. The following assertion must not
# fail: assert(INT_MIN <= ms && ms <= INT_MAX).
- large_timeout = _testcapi.INT_MAX + 1
+ if _testcapi is not None:
+ large_timeout = _testcapi.INT_MAX + 1
+ else:
+ large_timeout = 2147483648
# test recv() with large timeout
conn, addr = self.serv.accept()
@@ -5151,7 +5154,10 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
def _testLargeTimeout(self):
# test sendall() with large timeout
- large_timeout = _testcapi.INT_MAX + 1
+ if _testcapi is not None:
+ large_timeout = _testcapi.INT_MAX + 1
+ else:
+ large_timeout = 2147483648
self.cli.connect((HOST, self.port))
try:
self.cli.settimeout(large_timeout)