| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
| |
``_interpretersmodule.c`` (#137680)
|
| | |
|
| |
|
|
| |
(GH-121303)" (#136991)
|
| |
|
| |
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
|
| |
|
|
| |
(#135937)
|
| |
|
|
| |
`_interpreters.set___main___attrs` (gh-135856)
|
| |
|
|
|
|
| |
As noted in the new tests, there are a few situations we must carefully accommodate
for functions that get pickled during interp.call(). We do so by running the script
from the main interpreter's __main__ module in a hidden module in the other
interpreter. That hidden module is used as the function __globals__.
|
| |
|
|
|
|
|
|
|
|
| |
In this refactor we:
* move some code around
* make a couple of typedefs opaque
* decouple errors from session state
* improve tracebacks for propagated exceptions
This change helps simplify several upcoming changes.
|
| |
|
| |
It now supports most callables, full args, and return values.
|
| |
|
|
|
| |
This reverts commit 8a793c4a365d06a7264887698ccd7d6ba6aba9f2, AKA gh-134599.
This effectively re-applies commit 09e72cf (gh-134511)
|
| |
|
|
|
| |
This reverts commit 09e72cf091d, AKA gh-134511.
We are reverting due to refleaks on free-threaded builds.
|
| |
|
|
|
|
|
|
|
| |
This is mostly a refactor to clean things up a bit, most notably the "XI namespace" code.
Making the session opaque requires adding the following internal-only functions:
* _PyXI_NewSession()
* _PyXI_FreeSession()
* _PyXI_GetMainNamespace()
|
| | |
|
| |
|
|
| |
(gh-134439)
|
| |
|
| |
It now supports a "full" fallback to _PyFunction_GetXIData() and then `_PyPickle_GetXIData()`. There's also room for other fallback modes if that later makes sense.
|
| | |
|
| |
|
| |
This change consists of adding tests and moving code around, with some renaming thrown in.
|
| |
|
|
|
|
|
|
|
|
| |
The following are added to the internal C-API:
* _PyErr_FormatV()
* _PyErr_SetModuleNotFoundError()
* _PyXIData_GetNotShareableErrorType()
* _PyXIData_FormatNotShareableError()
We also drop _PyXIData_lookup_context_t and _PyXIData_GetLookupContext().
|
| |
|
| |
This is a partial revert of gh-132821. It resolves the refleak introduced by that PR.
|
| |
|
|
|
| |
* add notes
* rename XIBufferViewObject to xibufferview
* move memoryview XIData code to memoryobject.c
|
| |
|
|
|
|
|
|
| |
This change covers the following:
* dealloc: no cleanup if no buffer set
* dealloc: handle already-destroyed interpreter correctly
* handle errors in _memoryview_from_xid() correctly
* clean up the buffer if the xidata is never used
|
| | |
|
| | |
|
| |
|
|
|
| |
(#132175)
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
|
| |
|
| |
Remove also now unused includes in C files.
|
| |
|
|
|
| |
Fix UBSan failures for `XIBufferViewObject`
Remove redundant casts, suppress unused return values
|
| |
|
|
| |
(#127220)
|
| |
|
|
|
|
|
|
|
| |
These changes makes it easier to backport the _interpreters, _interpqueues, and _interpchannels modules to Python 3.12.
This involves the following:
* add the _PyXI_GET_STATE() and _PyXI_GET_GLOBAL_STATE() macros
* add _PyXIData_lookup_context_t and _PyXIData_GetLookupContext()
* add _Py_xi_state_init() and _Py_xi_state_fini()
|
| |
|
| |
This change makes it easier to backport the _interpreters, _interpqueues, and _interpchannels modules to Python 3.12.
|
| | |
|
| |
|
|
|
|
|
|
| |
The primary objective here is to allow some later changes to be cleaner. Mostly this involves renaming things and moving a few things around.
* CrossInterpreterData -> XIData
* crossinterpdatafunc -> xidatafunc
* split out pycore_crossinterp_data_registry.h
* add _PyXIData_lookup_t
|
| |
|
|
| |
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
| |
|
| |
It is faster and more obvious.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As reported in #117847 and #115366, an unpaired backtick in a docstring
tends to confuse e.g. Sphinx running on subclasses of standard library
objects, and the typographic style of using a backtick as an opening
quote is no longer in favor. Convert almost all uses of the form
The variable `foo' should do xyz
to
The variable 'foo' should do xyz
and also fix up miscellaneous other unpaired backticks (extraneous /
missing characters).
No functional change is intended here other than in human-readable
docstrings.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This PR adds the ability to enable the GIL if it was disabled at
interpreter startup, and modifies the multi-phase module initialization
path to enable the GIL when loading a module, unless that module's spec
includes a slot indicating it can run safely without the GIL.
PEP 703 called the constant for the slot `Py_mod_gil_not_used`; I went
with `Py_MOD_GIL_NOT_USED` for consistency with gh-104148.
A warning will be issued up to once per interpreter for the first
GIL-using module that is loaded. If `-v` is given, a shorter message
will be printed to stderr every time a GIL-using module is loaded
(including the first one that issues a warning).
|
|
|
See https://discuss.python.org/t/pep-734-multiple-interpreters-in-the-stdlib/41147/26.
|