summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_poll.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-12-14 17:18:39 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-12-14 17:18:39 (GMT)
commit03241e801780edd967923d1cce00c2d07b208e58 (patch)
tree4b989c68d63e46df115ba53a2ed9a0b0c6314c85 /Lib/test/test_poll.py
parent530a69fafce36317f1c83fe4998831f2d4284f3a (diff)
parent5da107ac7261d8359cd6e1a9a8e57f85176d1180 (diff)
downloadcpython-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.py13
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