Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dc3c53c

Browse files
committed
Don't use thread.exit_prog; let child die if EOF read
1 parent 3ac5b00 commit dc3c53c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Demo/threads/telnet.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def parent(s):
7272
if not data:
7373
# EOF -- exit
7474
sys.stderr.write( '(Closed by remote host)\n')
75-
thread.exit_prog(1)
75+
sys.exit(1)
7676
cleandata = ''
7777
for c in data:
7878
if opt:
@@ -108,6 +108,7 @@ def child(s):
108108
while 1:
109109
line = sys.stdin.readline()
110110
## print 'Got:', `line`
111+
if not line: break
111112
s.send(line)
112113

113114
main()

0 commit comments

Comments
 (0)