From: Guido van Rossum Date: Sun, 20 Oct 2013 04:26:34 +0000 (-0700) Subject: Break out of loop on EOF in asyncio echo test programs. X-Git-Tag: v3.4.0a4~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d49c47bfb0ea3bc2e7d8778d8002c0f628d97488;p=thirdparty%2FPython%2Fcpython.git Break out of loop on EOF in asyncio echo test programs. --- diff --git a/Lib/test/test_asyncio/echo.py b/Lib/test/test_asyncio/echo.py index f6ac0a30d341..006364bb007b 100644 --- a/Lib/test/test_asyncio/echo.py +++ b/Lib/test/test_asyncio/echo.py @@ -3,4 +3,6 @@ import os if __name__ == '__main__': while True: buf = os.read(0, 1024) + if not buf: + break os.write(1, buf) diff --git a/Lib/test/test_asyncio/echo3.py b/Lib/test/test_asyncio/echo3.py index f1f7ea7c9e21..064496736bf3 100644 --- a/Lib/test/test_asyncio/echo3.py +++ b/Lib/test/test_asyncio/echo3.py @@ -3,6 +3,8 @@ import os if __name__ == '__main__': while True: buf = os.read(0, 1024) + if not buf: + break try: os.write(1, b'OUT:'+buf) except OSError as ex: