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
METH_OLDARGS (0x0, i.e. no flag) was obsolete in python2
and is forbidden with python3.
(no-precommit-check)
Change-Id: I576042492d74ca69bd59ed6ea6264cb7562c650f
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
* 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
This is to keep things consistent throughout the Python binding.
Eventually, we should switch imports to aspects, which are more
modern Ada, but this should be done for all imports at the same
time, to maintain consistency.
Change-Id: Id413db8e434a9e0e966773c2bf4e9429bd8a45f0