mirror of
https://github.com/python/cpython.git
synced 2026-05-06 12:49:07 -04:00
Break out of loop on EOF in asyncio echo test programs.
This commit is contained in:
@@ -3,4 +3,6 @@ import os
|
||||
if __name__ == '__main__':
|
||||
while True:
|
||||
buf = os.read(0, 1024)
|
||||
if not buf:
|
||||
break
|
||||
os.write(1, buf)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user