- PyObject_GetAttrString returns a new ref which must
be decref'd.
- Over-referrenced class when calling internal method
Change-Id: I16170aaa3e8daeaf4ad02dcc4cfee3f53574574e
- 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
METH_OLDARGS (0x0, i.e. no flag) was obsolete in python2
and is forbidden with python3.
(no-precommit-check)
Change-Id: I576042492d74ca69bd59ed6ea6264cb7562c650f
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
Refinement on the previous change: do not pass the Python
static library to the linker if we are in the mode where
we are using the Python shared library.
Change-Id: I05a19d0f69a492106d04e612f299ea32ceeae1ea
Add a project variable to indicate the path to the libpython*.la,
and use this variable to find this when building.
Copy the .la file to the installation destination,
and use the variable to make sure the project generated by gprinstall
finds it.
Change-Id: Ic145f14339091ecb3bf6f10af14916de9fa176d4
To avoid conflict with installed gnatcoll.gpr where GNATCOLL_BUILD means
library type.
Part of S709-037.
Change-Id: I5a0164505bee8e4a93409615e7a9d3b9a85c02f3
Like for gnatcoll_core, these externals allow gnatcoll_*.gpr to be used
from a project that defines the BUILD external in an incompatible way.
Part of S709-037.
Change-Id: I409695393fb40d301e280a3f5ac7018e9d7bc81b
The test is creating a hidden property which can't be accessed
by at the python level => thus the last check is always wrong:
remove it.
Change-Id: I5dc8eff713e2e55cfcf97c5758a0fc6c463f69a2
The API between python2 and python3 has significantly changed
and having a different name will prevent dynamic linking issues.
Change-Id: I7ad5f5d470a658abfc67e65206a09919e0a68fe5
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