https://github.com/python/cpython/commit/c46acd3588864e97d0e0fe37a41aa5e94ac7af51
commit: c46acd3588864e97d0e0fe37a41aa5e94ac7af51
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2024-12-02T16:51:50+01:00
summary:

gh-126876: Fix test_socket.testLargeTimeout() for missing _testcapi (#127517)

files:
M Lib/test/test_socket.py

diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 7b3914f30e5f52..307d6e886c617f 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -5136,7 +5136,10 @@ def testLargeTimeout(self):
         # 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 @@ def testLargeTimeout(self):
 
     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)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to