1. Armin Rigo
  2. cpython-withatomic

Commits

sbt  committed aff7bb5

Minor fix for multiprocessing unit test

Read from socket might have returned partial message.

  • Participants
  • Parent commits 25cc0c8
  • Branches default

Comments (0)

Files changed (1)

File Lib/test/test_multiprocessing.py

View file
         address = lconn.recv()
         rconn.send((address, msg))
         new_conn = lconn.recv()
-        self.assertEqual(new_conn.recv(100), msg.upper())
+        buf = []
+        while True:
+            s = new_conn.recv(100)
+            if not s:
+                break
+            buf.append(s)
+        buf = b''.join(buf)
+        self.assertEqual(buf, msg.upper())
         new_conn.close()
 
         lconn.send(None)