diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-12-14 17:18:39 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-12-14 17:18:39 (GMT) |
commit | 03241e801780edd967923d1cce00c2d07b208e58 (patch) | |
tree | 4b989c68d63e46df115ba53a2ed9a0b0c6314c85 /Lib/test/test_poll.py | |
parent | 530a69fafce36317f1c83fe4998831f2d4284f3a (diff) | |
parent | 5da107ac7261d8359cd6e1a9a8e57f85176d1180 (diff) | |
download | cpython-03241e801780edd967923d1cce00c2d07b208e58.zip cpython-03241e801780edd967923d1cce00c2d07b208e58.tar.gz cpython-03241e801780edd967923d1cce00c2d07b208e58.tar.bz2 |
Issue #17919: Fixed integer overflow in the eventmask parameter.
Diffstat (limited to 'Lib/test/test_poll.py')
-rw-r--r-- | Lib/test/test_poll.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/test/test_poll.py b/Lib/test/test_poll.py index 8138294..41ca803 100644 --- a/Lib/test/test_poll.py +++ b/Lib/test/test_poll.py @@ -4,7 +4,7 @@ import os import subprocess import random import select -import _testcapi +from _testcapi import USHRT_MAX, INT_MAX, UINT_MAX try: import threading except ImportError: @@ -161,10 +161,13 @@ class PollTests(unittest.TestCase): if x != 5: self.fail('Overflow must have occurred') - pollster = select.poll() - # Issue 15989 - self.assertRaises(OverflowError, pollster.poll, _testcapi.INT_MAX + 1) - self.assertRaises(OverflowError, pollster.poll, _testcapi.UINT_MAX + 1) + # Issues #15989, #17919 + self.assertRaises(OverflowError, pollster.register, 0, -1) + self.assertRaises(OverflowError, pollster.register, 0, USHRT_MAX + 1) + self.assertRaises(OverflowError, pollster.modify, 1, -1) + self.assertRaises(OverflowError, pollster.modify, 1, USHRT_MAX + 1) + self.assertRaises(OverflowError, pollster.poll, INT_MAX + 1) + self.assertRaises(OverflowError, pollster.poll, UINT_MAX + 1) @unittest.skipUnless(threading, 'Threading required for this test.') @reap_threads |