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
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
* 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
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