diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2005-11-03 05:00:25 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2005-11-03 05:00:25 (GMT) |
commit | 0f46bbf7814476de107d16f67561d611d900f5a3 (patch) | |
tree | 239a33d35dcda550ee11dcc8602f1dc83fba9e00 /Lib | |
parent | 26f4c23074565ee46f6853138868a148b8ad7988 (diff) | |
download | cpython-0f46bbf7814476de107d16f67561d611d900f5a3.zip cpython-0f46bbf7814476de107d16f67561d611d900f5a3.tar.gz cpython-0f46bbf7814476de107d16f67561d611d900f5a3.tar.bz2 |
Bug #1346533, select.poll() doesn't raise an error if timeout > sys.maxint
Need to check return result of PyInt_AsLong()
Will backport.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_poll.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Lib/test/test_poll.py b/Lib/test/test_poll.py index 2ecae69..f99c37f 100644 --- a/Lib/test/test_poll.py +++ b/Lib/test/test_poll.py @@ -168,5 +168,25 @@ def test_poll2(): p.close() print 'Poll test 2 complete' +def test_poll3(): + # test int overflow + print 'Running poll test 3' + pollster = select.poll() + pollster.register(1) + + try: + pollster.poll(1L << 64) + except OverflowError: + pass + else: + print 'Expected OverflowError with excessive timeout' + + x = 2 + 3 + if x != 5: + print 'Overflow must have occurred' + print 'Poll test 3 complete' + + test_poll1() test_poll2() +test_poll3() |