diff options
Diffstat (limited to 'Lib/test/test_devpoll.py')
-rw-r--r-- | Lib/test/test_devpoll.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Lib/test/test_devpoll.py b/Lib/test/test_devpoll.py index 7fa4203..e634d3a 100644 --- a/Lib/test/test_devpoll.py +++ b/Lib/test/test_devpoll.py @@ -7,8 +7,7 @@ import random import select import sys import unittest -from test.support import TESTFN, run_unittest -from _testcapi import USHRT_MAX +from test.support import TESTFN, run_unittest, cpython_only try: select.devpoll @@ -121,15 +120,24 @@ class DevPollTests(unittest.TestCase): self.addCleanup(devpoll.close) self.assertEqual(os.get_inheritable(devpoll.fileno()), False) - def test_events_mask_overflow(self): pollster = select.devpoll() w, r = os.pipe() pollster.register(w) # Issue #17919 self.assertRaises(OverflowError, pollster.register, 0, -1) - self.assertRaises(OverflowError, pollster.register, 0, USHRT_MAX + 1) + self.assertRaises(OverflowError, pollster.register, 0, 1 << 64) self.assertRaises(OverflowError, pollster.modify, 1, -1) + self.assertRaises(OverflowError, pollster.modify, 1, 1 << 64) + + @cpython_only + def test_events_mask_overflow_c_limits(self): + from _testcapi import USHRT_MAX + pollster = select.devpoll() + w, r = os.pipe() + pollster.register(w) + # Issue #17919 + self.assertRaises(OverflowError, pollster.register, 0, USHRT_MAX + 1) self.assertRaises(OverflowError, pollster.modify, 1, USHRT_MAX + 1) |