Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
391f243
bpo-20182: initial application of issue20182.selectmodule.v2.patch
taleinat Oct 28, 2017
3423836
bpo-20182: AC convert new select.kqueue and fix missing summary lines
taleinat Oct 31, 2017
778d240
bpo-20182: selectmodule.c AC: move type and method defintions to bottom
taleinat Oct 31, 2017
378a27f
bpo-20182: selectmodule.c AC: add file descriptor argument converter
taleinat Nov 1, 2017
fc964f0
bpo-20182: selectmodule.c AC: convert select.devpoll to AC
taleinat Nov 1, 2017
b415d95
bpo-20182: selectmodule.c AC: fix and standardize use of ushort_conve…
taleinat Nov 1, 2017
352004c
bpo-20182: selectmodule.c AC: don't "as"-rename epoll method functions
taleinat Nov 1, 2017
b91b2db
bpo-20182: selectmodule.c AC: fix two compilation errors in epoll
taleinat Nov 3, 2017
7939e70
bpo-20182: selectmodule.c AC: re-run clinic.py after its recent bugfix
taleinat Nov 3, 2017
7de2e5d
bpo-31938: address remaining CR issues
taleinat Jun 22, 2018
15f4b0f
Merge branch 'master' into bpo-31938_AC_selectmodule
taleinat Jun 22, 2018
1173711
bpo-31938: describe return values of devpoll.poll() and epoll.poll()
taleinat Jun 24, 2018
65d2f0d
bpo-31938: re-run clinic.py on Modules/selectmodule.c
taleinat Jun 25, 2018
0b81db5
bpo-31938: fix a bug in select_kqueue_fromfd_impl
taleinat Jun 25, 2018
d5a8516
bpo-31938: minor doc-string formatting fix
taleinat Jun 25, 2018
cff3113
bpo-31938: fix select.devpoll.poll() timeout param to positional only
taleinat Jun 25, 2018
aa421fb
bpo-31938: re-run clinic.py on Modules/selectmodule.c (again)
taleinat Jun 25, 2018
1432332
bpo-31938: fix broken function reference in kqueue_queue_Type
taleinat Jun 25, 2018
1474605
Merge branch 'master' into bpo-31938_AC_selectmodule
taleinat Jun 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bpo-31938: address remaining CR issues
  • Loading branch information
taleinat committed Jun 22, 2018
commit 7de2e5d6658937a2eef25487a92ccc43e97f6fd8
2 changes: 1 addition & 1 deletion Doc/library/select.rst
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ Edge and Level Trigger Polling (epoll) Objects
Remove a registered file descriptor from the epoll object.


.. method:: epoll.poll(timeout=-1, maxevents=-1)
.. method:: epoll.poll(timeout=None, maxevents=-1)

Wait for events. timeout in seconds (float)

Expand Down
18 changes: 9 additions & 9 deletions Modules/clinic/selectmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions Modules/selectmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ select.poll.register

fd: fildes
either an integer, or an object with a fileno() method returning an int
eventmask: object(converter="ushort_converter", type="unsigned short", c_default="POLLIN | POLLOUT | POLLPRI") = POLLIN | POLLOUT | POLLPRI
eventmask: object(converter="ushort_converter", type="unsigned short", c_default="POLLIN | POLLPRI | POLLOUT") = POLLIN | POLLPRI | POLLOUT
an optional bitmask describing the type of events to check for
/

Expand All @@ -461,7 +461,7 @@ Register a file descriptor with the polling object.

static PyObject *
select_poll_register_impl(pollObject *self, int fd, unsigned short eventmask)
/*[clinic end generated code: output=0dc7173c800a4a65 input=e20f283a8250fb5e]*/
/*[clinic end generated code: output=0dc7173c800a4a65 input=499d96a2836217f5]*/
{
PyObject *key, *value;
int err;
Expand Down Expand Up @@ -590,7 +590,7 @@ select_poll_poll_impl(pollObject *self, PyObject *timeout_obj)
_PyTime_t timeout = -1, ms = -1, deadline = 0;
int async_err = 0;

if (timeout_obj != NULL && timeout_obj != Py_None) {
if (timeout_obj != Py_None) {
if (_PyTime_FromMillisecondsObject(&timeout, timeout_obj,
_PyTime_ROUND_TIMEOUT) < 0) {
if (PyErr_ExceptionMatches(PyExc_TypeError)) {
Expand Down Expand Up @@ -831,7 +831,7 @@ select.devpoll.register
fd: fildes
either an integer, or an object with a fileno() method returning
an int
eventmask: object(converter="ushort_converter", type="unsigned short", c_default="POLLIN | POLLOUT | POLLPRI") = POLLIN | POLLOUT | POLLPRI
eventmask: object(converter="ushort_converter", type="unsigned short", c_default="POLLIN | POLLPRI | POLLOUT") = POLLIN | POLLPRI | POLLOUT
an optional bitmask describing the type of events to check for
/

Expand All @@ -841,7 +841,7 @@ Register a file descriptor with the polling object.
static PyObject *
select_devpoll_register_impl(devpollObject *self, int fd,
unsigned short eventmask)
/*[clinic end generated code: output=6e07fe8b74abba0c input=c6bed777bd69a7bc]*/
/*[clinic end generated code: output=6e07fe8b74abba0c input=389a0785bb8feb57]*/
{
return internal_devpoll_register(self, fd, eventmask, 0);
}
Expand All @@ -852,7 +852,7 @@ select.devpoll.modify
fd: fildes
either an integer, or an object with a fileno() method returning
an int
eventmask: object(converter="ushort_converter", type="unsigned short", c_default="POLLIN | POLLOUT | POLLPRI") = POLLIN | POLLOUT | POLLPRI
eventmask: object(converter="ushort_converter", type="unsigned short", c_default="POLLIN | POLLPRI | POLLOUT") = POLLIN | POLLPRI | POLLOUT
an optional bitmask describing the type of events to check for
/

Expand All @@ -862,7 +862,7 @@ Modify a possible already registered file descriptor.
static PyObject *
select_devpoll_modify_impl(devpollObject *self, int fd,
unsigned short eventmask)
/*[clinic end generated code: output=bc2e6d23aaff98b4 input=2d8e3ddaa722656c]*/
/*[clinic end generated code: output=bc2e6d23aaff98b4 input=f0d7de3889cc55fb]*/
static PyObject *
devpoll_modify(devpollObject *self, PyObject *args)
{
Expand Down Expand Up @@ -921,7 +921,7 @@ select_devpoll_poll_impl(devpollObject *self, PyObject *timeout_obj)
return devpoll_err_closed();

/* Check values for timeout */
if (timeout_obj == NULL || timeout_obj == Py_None) {
if (timeout_obj == Py_None) {
timeout = -1;
ms = -1;
}
Expand Down Expand Up @@ -1434,7 +1434,7 @@ select.epoll.register

fd: fildes
the target file descriptor of the operation
eventmask: unsigned_int(c_default="EPOLLIN | EPOLLOUT | EPOLLPRI", bitwise=True) = EPOLLIN | EPOLLOUT | EPOLLPRI
eventmask: unsigned_int(c_default="EPOLLIN | EPOLLPRI | EPOLLOUT", bitwise=True) = EPOLLIN | EPOLLPRI | EPOLLOUT
a bit set composed of the various EPOLL constants

Registers a new fd or raises an OSError if the fd is already registered.
Expand All @@ -1445,7 +1445,7 @@ The epoll interface supports all file descriptors that support poll.
static PyObject *
select_epoll_register_impl(pyEpoll_Object *self, int fd,
unsigned int eventmask)
/*[clinic end generated code: output=318e5e6386520599 input=aee776f8e8d6d25f]*/
/*[clinic end generated code: output=318e5e6386520599 input=6cf699c152dd8ca9]*/
{
return pyepoll_internal_ctl(self->epfd, EPOLL_CTL_ADD, fd, eventmask);
}
Expand Down Expand Up @@ -1488,11 +1488,11 @@ select_epoll_unregister_impl(pyEpoll_Object *self, int fd)
/*[clinic input]
select.epoll.poll

timeout as timeout_obj: object(c_default="Py_None") = -1.0
timeout as timeout_obj: object = None
the maximum time to wait in seconds (as float);
a timeout of -1 makes poll wait indefinitely
a timeout of None or -1 makes poll wait indefinitely
maxevents: int = -1
the maximum number of events returned
the maximum number of events returned; -1 means no limit

Wait for events on the epoll file descriptor.
[clinic start generated code]*/
Expand Down Expand Up @@ -2063,7 +2063,7 @@ select_kqueue_control_impl(kqueue_queue_Object *self, PyObject *changelist,
return NULL;
}

if (otimeout == Py_None || otimeout == NULL) {
if (otimeout == Py_None) {
ptimeoutspec = NULL;
}
else {
Expand All @@ -2087,7 +2087,7 @@ select_kqueue_control_impl(kqueue_queue_Object *self, PyObject *changelist,
ptimeoutspec = &timeoutspec;
}

if (changelist != NULL && changelist != Py_None) {
if (changelist != Py_None) {
seq = PySequence_Fast(changelist, "changelist is not iterable");
if (seq == NULL) {
return NULL;
Expand Down