cpython: ac24e5c2fd3e (original) (raw)

Mercurial > cpython

changeset 104086:ac24e5c2fd3e

Issue #20100: Simplify newPyEpoll_Object() EPOLL_CLOEXEC is the only value that can be passed to epoll_create1() and we are passing EPOLL_CLOEXEC unconditionally since Python 3.4. [#20100]

Berker Peksag berker.peksag@gmail.com
date Mon, 26 Sep 2016 23:30:41 +0300
parents f91650739061
children 9fc2b6dba9c2
files Lib/test/test_epoll.py Modules/selectmodule.c
diffstat 2 files changed, 12 insertions(+), 8 deletions(-)[+] [-] Lib/test/test_epoll.py 2 Modules/selectmodule.c 18

line wrap: on

line diff

--- a/Lib/test/test_epoll.py +++ b/Lib/test/test_epoll.py @@ -76,6 +76,8 @@ class TestEPoll(unittest.TestCase): self.assertRaises(ValueError, ep.fileno) if hasattr(select, "EPOLL_CLOEXEC"): select.epoll(select.EPOLL_CLOEXEC).close()

def test_badcreate(self):

--- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -1252,7 +1252,7 @@ pyepoll_internal_close(pyEpoll_Object *s } static PyObject * -newPyEpoll_Object(PyTypeObject *type, int sizehint, int flags, SOCKET fd) +newPyEpoll_Object(PyTypeObject *type, int sizehint, SOCKET fd) { pyEpoll_Object *self; @@ -1264,12 +1264,10 @@ newPyEpoll_Object(PyTypeObject *type, in if (fd == -1) { Py_BEGIN_ALLOW_THREADS #ifdef HAVE_EPOLL_CREATE1

+#else

#endif

} @@ -1364,7 +1366,7 @@ pyepoll_fromfd(PyObject *cls, PyObject * if (!PyArg_ParseTuple(args, "i:fromfd", &fd)) return NULL;

} PyDoc_STRVAR(pyepoll_fromfd_doc,