mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-42413: socket.timeout is now an alias of TimeoutError (GH-23413)
Signed-off-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
7ddbaa7a1b
commit
03c8ddd9e9
24 changed files with 72 additions and 62 deletions
|
@ -2574,7 +2574,7 @@ class ThreadedEchoServer(threading.Thread):
|
|||
handler = self.ConnectionHandler(self, newconn, connaddr)
|
||||
handler.start()
|
||||
handler.join()
|
||||
except socket.timeout:
|
||||
except TimeoutError:
|
||||
pass
|
||||
except KeyboardInterrupt:
|
||||
self.stop()
|
||||
|
@ -3691,7 +3691,7 @@ class ThreadedTests(unittest.TestCase):
|
|||
c.settimeout(0.2)
|
||||
c.connect((host, port))
|
||||
# Will attempt handshake and time out
|
||||
self.assertRaisesRegex(socket.timeout, "timed out",
|
||||
self.assertRaisesRegex(TimeoutError, "timed out",
|
||||
test_wrap_socket, c)
|
||||
finally:
|
||||
c.close()
|
||||
|
@ -3700,7 +3700,7 @@ class ThreadedTests(unittest.TestCase):
|
|||
c = test_wrap_socket(c)
|
||||
c.settimeout(0.2)
|
||||
# Will attempt handshake and time out
|
||||
self.assertRaisesRegex(socket.timeout, "timed out",
|
||||
self.assertRaisesRegex(TimeoutError, "timed out",
|
||||
c.connect, (host, port))
|
||||
finally:
|
||||
c.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue