mirror of https://github.com/python/cpython.git
Break out of loop on EOF in asyncio echo test programs.
This commit is contained in:
parent
0acceb7697
commit
d49c47bfb0
|
@ -3,4 +3,6 @@
|
|||
if __name__ == '__main__':
|
||||
while True:
|
||||
buf = os.read(0, 1024)
|
||||
if not buf:
|
||||
break
|
||||
os.write(1, buf)
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
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:
|
||||
|
|
Loading…
Reference in New Issue