FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

try to always use the old API · python/cpython@83251c1 · GitHub

Repository navigation

Commit 83251c1

Browse files
committed
try to always use the old API
1 parent 95c1662 commit 83251c1

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎Modules/selectmodule.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,10 +1099,11 @@ newPyEpoll_Object(PyTypeObject *type, int sizehint, int flags, SOCKET fd)
10991099
if (fd == -1) {
11001100
Py_BEGIN_ALLOW_THREADS
11011101
#ifdef HAVE_EPOLL_CREATE1
1102-
self->epfd = epoll_create1(flags);
1103-
#else
1104-
self->epfd = epoll_create(sizehint);
1102+
if (flags)
1103+
self->epfd = epoll_create1(flags);
1104+
else
11051105
#endif
1106+
self->epfd = epoll_create(sizehint);
11061107
Py_END_ALLOW_THREADS
11071108
}
11081109
else {
@@ -1120,7 +1121,7 @@ newPyEpoll_Object(PyTypeObject *type, int sizehint, int flags, SOCKET fd)
11201121
static PyObject *
11211122
pyepoll_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
11221123
{
1123-
int flags = 0, sizehint = 0;
1124+
int flags = 0, sizehint = FD_SETSIZE - 1;
11241125
static char *kwlist[] = {"sizehint", "flags", NULL};
11251126

11261127
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|ii:epoll", kwlist,

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL