mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
bpo-40280: select: Use NULL for empty fdset (GH-31865)
wasm32-emscripten does not support exceptfds and requires NULL. Python now passes NULL instead of a fdset pointer when the input list is empty. This works fine on all platforms and might even be a tiny bit faster.
This commit is contained in:
parent
23abae621f
commit
f00ced8396
3 changed files with 8 additions and 2 deletions
|
|
@ -330,7 +330,12 @@ select_select_impl(PyObject *module, PyObject *rlist, PyObject *wlist,
|
|||
do {
|
||||
Py_BEGIN_ALLOW_THREADS
|
||||
errno = 0;
|
||||
n = select(max, &ifdset, &ofdset, &efdset, tvp);
|
||||
n = select(
|
||||
max,
|
||||
imax ? &ifdset : NULL,
|
||||
omax ? &ofdset : NULL,
|
||||
emax ? &efdset : NULL,
|
||||
tvp);
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
if (errno != EINTR)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue