From 17f22c92819640a3bc98079f34d43bf80fdea782 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 13 Dec 2013 12:09:05 +0200 Subject: [PATCH] Issue #17919: select.poll.poll() again works with poll.POLLNVAL on AIX. --- Lib/test/test_poll.py | 4 ---- Misc/NEWS | 2 ++ Modules/selectmodule.c | 5 ++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Lib/test/test_poll.py b/Lib/test/test_poll.py index 219fa0e464..7e94e3da9c 100644 --- a/Lib/test/test_poll.py +++ b/Lib/test/test_poll.py @@ -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) diff --git a/Misc/NEWS b/Misc/NEWS index 008e612b7d..6e54379d5d 100644 --- 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). diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index 6a3652160a..dcd6b9c258 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -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; } -- 2.50.1