Fix ada method descriptor creation in Cpython: since python3.12
the ada method descriptor type must be properly defined and
handle computation of __name__ and __qualname__.
Fix internal testsuite related to API changes of e3 and
add a test.
Fix CI using old component names
Depends-On: eng/shared/anod!7814
For eng/ide/gnatstudio#486
The base PyMODINIT_FUNC (without attributes) is PyObject* in python3,
not void. Adjust the redefinition we do on Windows to remove a declspec
accordingly.
- Disable the new vectorcall API (the tp_call profile only
supports the old call format).
- Add missing GIL locks
- Manually config python to use utf-8 (this was automatic with
previous versions)
Change-Id: I214b53e1e1b4fbc2a9af1cf1ec8985cff7905a55
Most of the commands can only be called if we have the GIL:
retrieve it.
Add a controlled type to automatically retrieve/free the GIL.
Lock every call using Py_INCREF/Py_DECREF.
Change-Id: I8989fcb3eacf6aedbb90056469536144a2795a3f
The cfunc is stored inside the descriptor when doing:
f = Foo()
f.bar() => cfunc is retrieved via tp_descr_get
Foo.bar(f) => cfunc is retrieved via tp_call
Without defining tp_call it will try to call a
wrapping function without the proper flags.
Change-Id: I164492895cee66dd4d9946b505c6866c2fea768a
Capsules should be used instead. Tentative of PyCObject simulation
cannot work as destructors associated with PyCObject and PyCapsule
do not have the same semantic (one receive the encapsulated C
pointer and the other the capsule).
This fix also memory issues in GNATCOLL.Scripts.Python
Part of T601-026
Change-Id: Id1793d255998a55b10d507deff1ce707d79a8932
Python 3.x modified the way CFunction with METH_STATIC flag are
called. Self attribute passed to PyCFunction_New is not passed
anymore to the C code. Removing the METH_STATIC flag ensure that
self is preserved. This ensure GNATCOLL.Scripts can bind C data
to the declared C function.
Part of S821-014
Part of T519-009
Change-Id: Ib51501df8302e2f0451924e954f3fb8b37ea89f1
* Move PyEval_SaveThread to GNATCOLL.Python.Eval
* Move PyEval_RestoreThread to GNATCOLL.Python.Eval
* Move PyThreadState to GNATCOLL.Python
* Remove binding to PyEval_InitThreads (not needed since 3.7)
* Remove Has_Thread_Support (we assume python 3 always have thread
support)
Part of S821-014
Change-Id: I037b19be518a36600663df20d34f233c91bc4139
This ensures function name maps to C API.
Also renames Dummy type into PyObject_Opaque as the type will be
used in other units.
Part of S821-014
Change-Id: I14a2d05897480c4dbfb3f04a2fe45567d2385a7b
* Py_SetProgramName expect a *wchar_t
* Py_SetPythonhome expect a *wchar_t
* Py_Main except decoded arguments as *wchar_t
* Expose function Py_DecodeLocale
Part of T518-013
Change-Id: I3ad1df239203ecf70e5de7dfe78aed202cd21666