diff options
author | Guido van Rossum <guido@python.org> | 1997-05-08 23:14:57 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-05-08 23:14:57 (GMT) |
commit | de554ece418b241ad5058b1e600040c0d1c01891 (patch) | |
tree | 787ca28dc2f8582e7ce7f0bb535ef865bf1c7f9f /Lib/dos_8x3/test_sel.py | |
parent | 6dd87830d091673741a4aabfb0680ae5ca64c257 (diff) | |
download | cpython-de554ece418b241ad5058b1e600040c0d1c01891.zip cpython-de554ece418b241ad5058b1e600040c0d1c01891.tar.gz cpython-de554ece418b241ad5058b1e600040c0d1c01891.tar.bz2 |
The usual.
Diffstat (limited to 'Lib/dos_8x3/test_sel.py')
-rwxr-xr-x | Lib/dos_8x3/test_sel.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Lib/dos_8x3/test_sel.py b/Lib/dos_8x3/test_sel.py index f7f20f3..32ccfd1 100755 --- a/Lib/dos_8x3/test_sel.py +++ b/Lib/dos_8x3/test_sel.py @@ -1,4 +1,5 @@ # Testing select module +from test_support import verbose import select import os @@ -33,19 +34,27 @@ else: def test(): + import sys + if sys.platform in ('win', 'mac'): + if verbose: + print "Can't test select easily" + return cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done' p = os.popen(cmd, 'r') for tout in (0, 1, 2, 4, 8, 16) + (None,)*10: - print 'timeout =', tout + if verbose: + print 'timeout =', tout rfd, wfd, xfd = select.select([p], [], [], tout) ## print rfd, wfd, xfd if (rfd, wfd, xfd) == ([], [], []): continue if (rfd, wfd, xfd) == ([p], [], []): line = p.readline() - print `line` + if verbose: + print `line` if not line: - print 'EOF' + if verbose: + print 'EOF' break continue print 'Heh?' |