| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Add PyThreadState_GetID() function: get the unique identifier of a
Python thread state.
|
| |
|
|
|
|
|
| |
_tracemalloc.c and _xxsubinterpretersmodule.c use
PyThreadState_GetFrame() and PyThreadState_GetInterpreter() to no
longer depend on the PyThreadState structure.
|
| |
|
| |
|
|
|
|
| |
(GH-19151)
|
|
|
|
| |
(GH-19150)
|
|
|
|
|
|
| |
Update _asyncio, _bz2, _csv, _curses, _datetime,
_io, _operator, _pickle, _queue, blake2,
multibytecodec and overlapped C extension modules
to use PyModule_AddType().
|
|
|
|
|
| |
(PEP 489) (GH-19140)
Co-authored-by: Hai Shi <shihai1992@gmail.com>
|
|
|
|
|
|
|
|
| |
Fix os.getgrouplist(): if getgrouplist() function fails because the
group list is too small, retry with a larger group list.
On failure, the glibc implementation of getgrouplist() sets ngroups
to the total number of groups. For other implementations, double the
group list size.
|
|
|
|
| |
(GH-18969)
|
|
|
| |
Co-authored-by: Benjamin Peterson <benjamin@python.org>
|
|
|
|
|
|
| |
initialization (PEP 489) (GH-19084)" (#19128)
bpo-1635741, bpo-40050: This reverts
commit 8334f30a74abcf7e469b901afc307887aa85a888.
|
| |
|
|
|
|
|
| |
On macOS, getgrouplist() returns a non-zero value without setting
errno if the group list is too small. Double the list size and call
it again in this case.
|
| |
|
| |
|
|
|
|
| |
(GH-18942)
|
|
|
|
|
|
|
|
|
| |
COMPUTE_EVAL_BREAKER() now also checks if the Python thread state
belongs to the main interpreter. Don't break the evaluation loop if
there are pending signals but the Python thread state it belongs to a
subinterpeter.
* Add _Py_IsMainThread() function.
* Add _Py_ThreadCanHandleSignals() function.
|
|
|
|
| |
(PEP 489) (GH-19084)
|
|
|
| |
Automerge-Triggered-By: @vstinner
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If Py_AddPendingCall() is called in a subinterpreter, the function is
now scheduled to be called from the subinterpreter, rather than being
called from the main interpreter.
Each subinterpreter now has its own list of scheduled calls.
* Move pending and eval_breaker fields from _PyRuntimeState.ceval
to PyInterpreterState.ceval.
* new_interpreter() now calls _PyEval_InitThreads() to create
pending calls lock.
* Fix Py_AddPendingCall() for subinterpreters. It now calls
_PyThreadState_GET() which works in a subinterpreter if the
caller holds the GIL, and only falls back on
PyGILState_GetThisThreadState() if _PyThreadState_GET()
returns NULL.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
bpo-37127, bpo-39984:
* trip_signal() and Py_AddPendingCall() now get the current Python
thread state using PyGILState_GetThisThreadState() rather than
_PyRuntimeState_GetThreadState() to be able to get it even if the
GIL is released.
* _PyEval_SignalReceived() now expects tstate rather than ceval.
* Remove ceval parameter of _PyEval_AddPendingCall(): ceval is now
get from tstate parameter.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* _PyThreadState_DeleteCurrent() now takes tstate rather than
runtime.
* Add ensure_tstate_not_null() helper to pystate.c.
* Add _PyEval_ReleaseLock() function.
* _PyThreadState_DeleteCurrent() now calls
_PyEval_ReleaseLock(tstate) and frees PyThreadState memory after
this call, not before.
* PyGILState_Release(): rename "tcur" variable to "tstate".
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extension modules: m_traverse, m_clear and m_free functions of
PyModuleDef are no longer called if the module state was requested
but is not allocated yet. This is the case immediately after the
module is created and before the module is executed (Py_mod_exec
function). More precisely, these functions are not called if m_size is
greater than 0 and the module state (as returned by
PyModule_GetState()) is NULL.
Extension modules without module state (m_size <= 0) are not affected.
Co-Authored-By: Petr Viktorin <encukou@gmail.com>
|
| |
|
|
|
|
| |
489) (GH-19012)
|
| |
|
| |
|
|
|
|
| |
functions (GH-19017)
|
|
|
|
| |
(GH-18412)
|
|
|
|
|
|
| |
In math_2(), the first PyFloat_AsDouble() call should be checked
for failure before the second call.
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
|
|
|
|
|
|
|
| |
* Revert "bpo-39087: Add _PyUnicode_GetUTF8Buffer() (GH-17659)"
This reverts commit c7ad974d341d3edb6b9d2a2dcae4d3d4794ada6b.
* Update unicodeobject.h
|
|
|
| |
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
| |
Add PyThreadState_GetInterpreter(tstate): get the interpreter of a
Python thread state.
|
|
|
|
|
|
| |
* Rename _PyInterpreterState_Get() to PyInterpreterState_Get() and
move it the limited C API.
* Add _PyInterpreterState_Get() alias to PyInterpreterState_Get() for
backward compatibility with Python 3.8.
|
|
|
|
|
|
|
| |
Replace _PyInterpreterState_Get() function call with
_PyInterpreterState_GET_UNSAFE() macro which is more efficient but
don't check if tstate or interp is NULL.
_Py_GetConfigsAsDict() now uses _PyThreadState_GET().
|
|
|
|
|
|
|
|
|
| |
* sys.settrace(), sys.setprofile() and _lsprof.Profiler.enable() now
properly report PySys_Audit() error if "sys.setprofile" or
"sys.settrace" audit event is denied.
* Add _PyEval_SetProfile() and _PyEval_SetTrace() function: similar
to PyEval_SetProfile() and PyEval_SetTrace() but take a tstate
parameter and return -1 on error.
* Add _PyObject_FastCallTstate() function.
|
|
|
|
|
| |
Move get_recursion_depth() function from _testcapi to
_testinternalcapi to avoid accessing PyThreadState attributes
directly in _testcapi.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
489) (GH-18608)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
| |
489) (GH-18358)
Co-authored-by: Petr Viktorin <pviktori@redhat.com>
|
| |
|