summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/selectmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 0ff09b4..22106b1 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -1212,7 +1212,7 @@ newPyEpoll_Object(PyTypeObject *type, int sizehint, int flags, SOCKET fd)
}
#ifndef HAVE_EPOLL_CREATE1
- if (_Py_set_inheritable(self->epfd, 0, NULL) < 0) {
+ if (fd == -1 && _Py_set_inheritable(self->epfd, 0, NULL) < 0) {
Py_DECREF(self);
return NULL;
}