10000 extmod/modselect: Remove undocumented support for flags arg to poll. · micropython/micropython@7e0bb18 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7e0bb18

Browse files
committed
extmod/modselect: Remove undocumented support for flags arg to poll.
The signature of this method was poller.poll(timeout=-1, flags=0, /) but the flags argument was not documented and is not CPython compatible. So it's removed in this commit. (The optional flags remains for the ipoll() method, which is documented.) Signed-off-by: Damien George <damien@micropython.org>
1 parent 34b6002 commit 7e0bb18

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

extmod/modselect.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#endif
5151
#endif
5252

53-
// Flags for poll()
53+
// Flags for ipoll()
5454
#define FLAG_ONESHOT (1)
5555

5656
// A single pollable object.
@@ -505,15 +505,11 @@ STATIC mp_obj_t poll_poll(size_t n_args, const mp_obj_t *args) {
505505
if (poll_obj_get_flags_ret(poll_obj) != 0) {
506506
mp_obj_t tuple[2] = {poll_obj->obj, MP_OBJ_NEW_SMALL_INT(poll_obj_get_flags_ret(poll_obj))};
507507
ret_list->items[n_ready++] = mp_obj_new_tuple(2, tuple);
508-
if (self->flags & FLAG_ONESHOT) {
509-
// Don't poll next time, until new event flags will be set explicitly
510-
poll_obj_set_flags(poll_obj, 0);
511-
}
512508
}
513509
}
514510
return MP_OBJ_FROM_PTR(ret_list);
515511
}
516-
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(poll_poll_obj, 1, 3, poll_poll);
512+
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(poll_poll_obj, 1, 2, poll_poll);
517513

518514
STATIC mp_obj_t poll_ipoll(size_t n_args, const mp_obj_t *args) {
519515
mp_obj_poll_t *self = MP_OBJ_TO_PTR(args[0]);

0 commit comments

Comments
 (0)
0