]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
test_asyncore: Optimize capture_server() (#93867)
authorVictor Stinner <vstinner@python.org>
Wed, 15 Jun 2022 16:28:31 +0000 (18:28 +0200)
committerGitHub <noreply@github.com>
Wed, 15 Jun 2022 16:28:31 +0000 (18:28 +0200)
Remove time.sleep(0.01) in test_asyncore capture_server(). The sleep
was redundant and inefficient, since the loop starts with
select.select() which also implements a sleep (poll for socket data
with a timeout).

Lib/test/test_asyncore.py

index 1564221f8571535a3ba18f292638c66d3c5fb6cd..dd6b3a3648e6b95f9068b2727b843e30d4712d5f 100644 (file)
@@ -87,7 +87,6 @@ def capture_server(evt, buf, serv):
                     break
             if n <= 0:
                 break
-            time.sleep(0.01)
 
         conn.close()
     finally: