]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Don't use thread.exit_prog; let child die if EOF read
authorGuido van Rossum <guido@python.org>
Mon, 16 May 1994 09:30:26 +0000 (09:30 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 16 May 1994 09:30:26 +0000 (09:30 +0000)
Demo/threads/telnet.py

index 5d4ae76cad71e76735abf17a0087ab0ae793cb00..f63d9550bfc3913615954ff82026f30d86c831d6 100644 (file)
@@ -72,7 +72,7 @@ def parent(s):
                if not data:
                        # EOF -- exit
                        sys.stderr.write( '(Closed by remote host)\n')
-                       thread.exit_prog(1)
+                       sys.exit(1)
                cleandata = ''
                for c in data:
                        if opt:
@@ -108,6 +108,7 @@ def child(s):
        while 1:
                line = sys.stdin.readline()
 ##             print 'Got:', `line`
+               if not line: break
                s.send(line)
 
 main()