We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5471420 commit 1f511e1Copy full SHA for 1f511e1
Lib/test/test_socket.py
@@ -5787,11 +5787,10 @@ def testWithTimeout(self):
5787
5788
def _testWithTimeoutTriggeredSend(self):
5789
address = self.serv.getsockname()
5790
- file = open(support.TESTFN, 'rb')
5791
- with socket.create_connection(address, timeout=0.01) as sock, \
5792
- file as file:
5793
- meth = self.meth_from_sock(sock)
5794
- self.assertRaises(socket.timeout, meth, file)
+ with open(support.TESTFN, 'rb') as file:
+ with socket.create_connection(address, timeout=0.01) as sock:
+ meth = self.meth_from_sock(sock)
+ self.assertRaises(socket.timeout, meth, file)
5795
5796
def testWithTimeoutTriggeredSend(self):
5797
conn = self.accept_conn()
0 commit comments