Commit Graph

9 Commits

Author SHA1 Message Date
Dmitriy Anisimkov
335f34c0d2 Fix compilation issue in debug mode
no-tn-check

Add Unreferenced mark to unreferenced but necessary variable.

Change-Id: Ia27e62b67544a9ee78f0f7a2276771476a6e62b5
2021-03-23 16:51:44 +01:00
Adrien Boulanger
fc63e2906b U201-012: Ensure frame state when calling python function.
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
2021-02-25 11:17:13 +01:00
Nicolas Roche
6140ee8e69 Remove simulation of PyCObjects in Python 3.x
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
2020-06-16 09:55:43 +00:00
Nicolas Roche
9c61fb6fe9 Move declaration of PyGILState_* functions to GNATCOLL.Python.State
Part of S821-014

Change-Id: I3f43a40c59942f50ae29d286be858a7739922c74
2020-05-28 11:04:12 +02:00
Nicolas Roche
af397296fd Move declaration of python thread related bindings under GNATCOLL.Python
* 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
2020-05-27 07:00:24 +00:00
Nicolas Roche
d17cadce7f Move PyErr_Occured to GNATCOLL.Python.Errors
Part of S821-014

Change-Id: Ibff41518354899137b19782803247dce39654614
2020-05-27 07:00:24 +00:00
Nicolas Roche
955181d8af Move Py_Initialize and Py_Finalize to GNATCOLL.Python.Lifecycle
Part of S821-014

Change-Id: I5c62565f7af598a692d96a560d7482d349ebd4ee
2020-05-25 12:29:19 +00:00
Nicolas Roche
e259adfecb Fix issue with binding of the interpreter lifecycle functions
* 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
2020-05-22 16:05:10 +00:00
Nicolas Roche
4981602c6d Split support for Python 3.x and Python 2.x
Part of S821-014

Change-Id: I17a26eb45043f7fe48b5b33db57425abe8cd9b78
2020-02-07 10:26:11 +01:00