diff options
Diffstat (limited to 'Lib/test/test_asyncore.py')
-rw-r--r-- | Lib/test/test_asyncore.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py index fca5b29..6f848a7 100644 --- a/Lib/test/test_asyncore.py +++ b/Lib/test/test_asyncore.py @@ -65,12 +65,14 @@ def capture_server(evt, buf): else: n = 200 while n > 0: - data = conn.recv(10) - assert isinstance(data, bytes) - # keep everything except for the newline terminator - buf.write(data.replace(b'\n', b'')) - if b'\n' in data: - break + r, w, e = select.select([conn], [], []) + if r: + data = conn.recv(10) + assert isinstance(data, bytes) + # keep everything except for the newline terminator + buf.write(data.replace(b'\n', b'')) + if b'\n' in data: + break n -= 1 time.sleep(0.01) |