# 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()
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)