Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dfad1a9

Browse files
committed
Fix a typo.
Add a sleep (yuck!) to _testRecvFrom() so the server can set up first.
1 parent 022640d commit dfad1a9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/test/test_socket.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,14 @@ def _testSendtoAndRecv(self):
359359
self.cli.sendto(MSG, 0, (HOST, PORT))
360360

361361
def testRecvFrom(self):
362-
"""Testing recfrom() over UDP."""
362+
"""Testing recvfrom() over UDP."""
363363
msg, addr = self.serv.recvfrom(len(MSG))
364364
hostname, port = addr
365365
##self.assertEqual(hostname, socket.gethostbyname('localhost'))
366366
self.assertEqual(msg, MSG)
367367

368368
def _testRecvFrom(self):
369+
time.sleep(1) # Give server a chance to set up
369370
self.cli.sendto(MSG, 0, (HOST, PORT))
370371

371372
class NonBlockingTCPTests(ThreadedTCPSocketTest):

0 commit comments

Comments
 (0)