Don't reference removed files in Makefile
[python/dscho.git] / Lib / test / test_select.py
blobf1853087f295d78072cbc377a91da5b573f51dbe
1 # Testing select module
3 def test():
4 import select
5 import os
6 cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do date; sleep 3; done'
7 p = os.popen(cmd, 'r')
8 for tout in (0, 1, 2, 4, 8, 16) + (None,)*10:
9 print 'timeout =', tout
10 rfd, wfd, xfd = select.select([p], [], [], tout)
11 print rfd, wfd, xfd
12 if (rfd, wfd, xfd) == ([], [], []):
13 continue
14 if (rfd, wfd, xfd) == ([p], [], []):
15 line = p.readline()
16 print `line`
17 if not line:
18 print 'EOF'
19 break
20 continue
21 print 'Heh?'
23 test()