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