]> granicus.if.org Git - python/commitdiff
Issue #17919: select.poll.poll() again works with poll.POLLNVAL on AIX.
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 13 Dec 2013 10:09:05 +0000 (12:09 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Fri, 13 Dec 2013 10:09:05 +0000 (12:09 +0200)
Lib/test/test_poll.py
Misc/NEWS
Modules/selectmodule.c

index 219fa0e4647b484667792098ca301add1b944544..7e94e3da9c8b92f89e1f0ec0bcfc354468c4bf09 100644 (file)
@@ -161,10 +161,6 @@ class PollTests(unittest.TestCase):
 
         pollster = select.poll()
         # Issue 15989
-        self.assertRaises(OverflowError, pollster.register, 0,
-                          _testcapi.SHRT_MAX + 1)
-        self.assertRaises(OverflowError, pollster.register, 0,
-                          _testcapi.USHRT_MAX + 1)
         self.assertRaises(OverflowError, pollster.poll, _testcapi.INT_MAX + 1)
         self.assertRaises(OverflowError, pollster.poll, _testcapi.UINT_MAX + 1)
 
index 008e612b7db642c638b90e01c5b59de77ace9075..6e54379d5d145e527a3280fc9487f95b8e76350c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -23,6 +23,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #17919: select.poll.poll() again works with poll.POLLNVAL on AIX.
+
 - Issue #17200: telnetlib's read_until and expect timeout was broken by the
   fix to Issue #14635 in Python 2.7.4 to be interpreted as milliseconds
   instead of seconds when the platform supports select.poll (ie: everywhere).
index 6a3652160a944fe91c173fac60211c5212a06c1a..dcd6b9c2586a9bc12bb6b4ea88932f3290f7a7f9 100644 (file)
@@ -366,11 +366,10 @@ static PyObject *
 poll_register(pollObject *self, PyObject *args)
 {
     PyObject *o, *key, *value;
-    int fd;
-    short events = POLLIN | POLLPRI | POLLOUT;
+    int fd, events = POLLIN | POLLPRI | POLLOUT;
     int err;
 
-    if (!PyArg_ParseTuple(args, "O|h:register", &o, &events)) {
+    if (!PyArg_ParseTuple(args, "O|i:register", &o, &events)) {
         return NULL;
     }