eaec52be194b7c20b7ce7aaaa35afc63273b6fb3
from test
.test_support
import verbose
# test some known error conditions
rfd
, wfd
, xfd
= select
.select(1, 2, 3)
print 'expected TypeError exception not raised'
rfd
, wfd
, xfd
= select
.select([Nope()], [], [])
print 'expected TypeError exception not raised'
rfd
, wfd
, xfd
= select
.select([Almost()], [], [])
print 'expected TypeError exception not raised'
rfd
, wfd
, xfd
= select
.select([], [], [], 'not a number')
print 'expected TypeError exception not raised'
if sys
.platform
[:3] in ('win', 'mac', 'os2', 'riscos'):
print "Can't test select easily on", sys
.platform
cmd
= 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done'
for tout
in (0, 1, 2, 4, 8, 16) + (None,)*10:
rfd
, wfd
, xfd
= select
.select([p
], [], [], tout
)
if (rfd
, wfd
, xfd
) == ([], [], []):
if (rfd
, wfd
, xfd
) == ([p
], [], []):
print 'Unexpected return values from select():', rfd
, wfd
, xfd