| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
(GH-95272)
Co-authored-by: Christian Heimes <christian@python.org>
|
| |
|
|
|
| |
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.
|
| |
|
|
| |
select.depoll() doc-strings (GH-22406)
|
| |
|
|
|
|
|
|
|
|
| |
Move almost all private functions of Include/cpython/fileutils.h to
the internal C API Include/internal/pycore_fileutils.h.
Only keep _Py_fopen_obj() in Include/cpython/fileutils.h, since it's
used by _testcapi which must not use the internal C API.
Move EncodeLocaleEx() and DecodeLocaleEx() functions from _testcapi
to _testinternalcapi, since the C API moved to the internal C API.
|
| |
|
|
|
|
|
|
| |
Add a private C API for deadlines: add _PyDeadline_Init() and
_PyDeadline_Get() functions.
* Add _PyTime_Add() and _PyTime_Mul() functions which compute t1+t2
and t1*t2 and clamp the result on overflow.
* _PyTime_MulDiv() now uses _PyTime_Add() and _PyTime_Mul().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the _PyTime_AsTimespec_clamp() function: similar to
_PyTime_AsTimespec(), but clamp to _PyTime_t min/max and don't raise
an exception.
PyThread_acquire_lock_timed() now uses _PyTime_AsTimespec_clamp() to
remove the Py_UNREACHABLE() code path.
* Add _PyTime_AsTime_t() function.
* Add PY_TIME_T_MIN and PY_TIME_T_MAX constants.
* Replace _PyTime_AsTimeval_noraise() with _PyTime_AsTimeval_clamp().
* Add pytime_divide_round_up() function.
* Fix integer overflow in pytime_divide().
* Add pytime_divmod() function.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
No longer use deprecated aliases to functions:
* Replace PyObject_MALLOC() with PyObject_Malloc()
* Replace PyObject_REALLOC() with PyObject_Realloc()
* Replace PyObject_FREE() with PyObject_Free()
* Replace PyObject_Del() with PyObject_Free()
* Replace PyObject_DEL() with PyObject_Free()
|
| |
|
|
|
|
|
|
|
|
|
| |
No longer use deprecated aliases to functions:
* Replace PyMem_MALLOC() with PyMem_Malloc()
* Replace PyMem_REALLOC() with PyMem_Realloc()
* Replace PyMem_FREE() with PyMem_Free()
* Replace PyMem_Del() with PyMem_Free()
* Replace PyMem_DEL() with PyMem_Free()
Modify also the PyMem_DEL() macro to use directly PyMem_Free().
|
| | |
|
| |
|
|
|
|
|
| |
If PyDict_GetItemWithError is only used to check whether the key is in dict,
it is better to use PyDict_Contains instead.
And if it is used in combination with PyDict_SetItem, PyDict_SetDefault can
replace the combination.
|
| |
|
|
| |
"fildes". (GH-22620)
|
| |
|
|
| |
module (GH-21066)
|
| |
|
|
| |
Fix reference leak in PyInit_select() of the select module:
remove Py_INCREF(poll_Type).
|
| |
|
|
| |
(GH-16832)
|
| | |
|
| |
|
|
|
|
| |
If only offsetof() is needed: include stddef.h instead.
When structmember.h is used, add a comment explaining that
PyMemberDef is used.
|
| |
|
|
| |
functions (GH-19017)
|
| |
|
|
| |
The select.epoll.unregister() method no longer ignores the EBADF
error.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
* Convert select module to PEP-384
Summary: Do the necessary versions to be Pyro-compatible, including migrating `PyType_Ready` to `PyType_FromSpec` and moving static data into a new `_selectstate` struct.
* 📜🤖 Added by blurb_it.
* Fixup Mac OS/X build
|
| | |
|
| |
|
|
|
|
|
|
|
| |
(GH-13464)
Automatically replace
tp_print -> tp_vectorcall_offset
tp_compare -> tp_as_async
tp_reserved -> tp_as_async
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
In _localemodule.c and selectmodule.c, remove dead code that would
cause double decrefs if run.
In addition, replace PyList_SetItem() with PyList_SET_ITEM() in cases
where a new list is populated and there is no possibility of an error.
In addition, check if the list changed size in the loop in array_array_fromlist().
|
| |
|
|
|
|
| |
select() calls are retried on EINTR (per PEP 475). However, if a
timeout was provided and the deadline has passed after running the
signal handlers, rlist, wlist and xlist should be cleared since select(2)
left them unmodified.
|
| |
|
| |
Fix also return type for few other functions (clear, releasebuffer).
|
| |
|
|
|
|
|
| |
Although the kernel accepts any negative value for timeout, the
documented value to block indefinitely is -1.
This commit also makes the code similar to select.poll.poll().
|
| |
|
|
|
|
| |
Fix compile errors reported by HP aCC by fixing bugs introduced in 6dc57e2a20c
which do not cause trouble on clang or GCC.
Patch by Michael Osipov.
|
| |
|
|
| |
Clinic. (GH-8434)
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* `flags` is indeed deprecated, but there is a validation on its value for
backwards compatibility reasons. This adds mention of this in the docs.
* The docs say that `sizehint` is deprecated and ignored, but it is still
used when `epoll_create1()` is unavailable. This adds mention of this in
the docs.
* `sizehint=-1` is acceptable again, and is replaced with `FD_SETSIZE-1`.
This is needed to have a default value available at the Python level,
since `FD_SETSIZE` is not exposed to Python. (see: bpo-31938)
* Reject `sizehint=0` since it is invalid to pass on to `epoll_create()`.
The relevant tests have also been updated.
|
| |
|
|
|
|
|
|
|
| |
(GH-6030)
METH_NOARGS functions need only a single argument but they are cast
into a PyCFunction, which takes two arguments. This triggers an
invalid function cast warning in gcc8 due to the argument mismatch.
Fix this by adding a dummy unused argument.
|
| | |
|
| |
|
|
|
| |
EPOLL_CLOEXEC is not defined on Android.
Co-Authored-By: Wataru Matsumoto <sxsns243@gmail.com>
|
| |
|
|
| |
functions (GH-793)
|
| |
|
|
|
| |
* Fix a compilation error on FreeBSD.
* Fix the data attribute size on Mac OS X.
|
| |
|
|
| |
* Fixed the layout of the kqueue_event structure on OpenBSD and NetBSD.
* Fixed the comparison of the kqueue_event objects.
|
| |
|
|
|
|
| |
Always pass -1, or INFTIM where defined, to the poll() system call when
a negative timeout is passed to the poll.poll([timeout]) method in the
select module. Various OSes throw an error with arbitrary negative
values.
|
| |
|
|
| |
small negative value. (#4003)
|
| | |
|
| |
|
|
|
|
| |
raised an error.
Replace them with using concrete types API that never fails if appropriate.
|
| | |
|
| |
|
| |
FreeBSD is the only platforms with unsigned FD_SETSIZE.
|
| |
|
|
| |
possible. Patch is writen with Coccinelle.
|
| |
|
|
| |
dict.
|
| |
|
|
|
|
| |
EPOLL_CLOEXEC is the only value that can be passed
to epoll_create1() and we are passing EPOLL_CLOEXEC
unconditionally since Python 3.4.
|
| |
|
|
| |
Patch by Ed Schouten.
|
| | |
|