summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorAlexey Izbyshev <izbyshev@ispras.ru>2023-12-01 15:44:03 (GMT)
committerGitHub <noreply@github.com>2023-12-01 15:44:03 (GMT)
commit0443f926becc38480fe60529ad9049ccceb635bd (patch)
treebe8e56bd11c6d52b2635ef1429a3fa378412bf2d /Lib/test/test_socket.py
parenteb3c0dc66760d24fc64eaddcc705519ed621f84b (diff)
downloadcpython-0443f926becc38480fe60529ad9049ccceb635bd.zip
cpython-0443f926becc38480fe60529ad9049ccceb635bd.tar.gz
cpython-0443f926becc38480fe60529ad9049ccceb635bd.tar.bz2
[3.11] bpo-35191: Fix unexpected integer truncation in socket.setblocking() (GH-10415)
On platforms with 64-bit long, socket.setblocking(x) treated all x which lower 32 bits are zero as False due to integer truncation. Reported by ubsan.
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 3fceac3..f6941e7 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -4705,10 +4705,10 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
self.skipTest('needs UINT_MAX < ULONG_MAX')
self.serv.setblocking(False)
- self.assertEqual(self.serv.gettimeout(), 0.0)
+ self.assert_sock_timeout(self.serv, 0.0)
self.serv.setblocking(_testcapi.UINT_MAX + 1)
- self.assertIsNone(self.serv.gettimeout())
+ self.assert_sock_timeout(self.serv, None)
_testSetBlocking_overflow = support.cpython_only(_testSetBlocking)