Commit d49c47bf authored by Guido van Rossum's avatar Guido van Rossum

Break out of loop on EOF in asyncio echo test programs.

parent 0acceb76
...@@ -3,4 +3,6 @@ import os ...@@ -3,4 +3,6 @@ import os
if __name__ == '__main__': if __name__ == '__main__':
while True: while True:
buf = os.read(0, 1024) buf = os.read(0, 1024)
if not buf:
break
os.write(1, buf) os.write(1, buf)
...@@ -3,6 +3,8 @@ import os ...@@ -3,6 +3,8 @@ import os
if __name__ == '__main__': if __name__ == '__main__':
while True: while True:
buf = os.read(0, 1024) buf = os.read(0, 1024)
if not buf:
break
try: try:
os.write(1, b'OUT:'+buf) os.write(1, b'OUT:'+buf)
except OSError as ex: except OSError as ex:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment