diff options
Diffstat (limited to 'plugins/pychrysalide/helpers.h')
-rw-r--r-- | plugins/pychrysalide/helpers.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/plugins/pychrysalide/helpers.h b/plugins/pychrysalide/helpers.h index cc82bba..f2dcdfc 100644 --- a/plugins/pychrysalide/helpers.h +++ b/plugins/pychrysalide/helpers.h @@ -152,14 +152,11 @@ bool register_python_module_object(PyObject *, PyTypeObject *); * * Cf. http://stackoverflow.com/questions/20432335/can-python-abstract-base-classes-inherit-from-c-extensions */ -#define APPLY_ABSTRACT_FLAG(tp) tp->tp_new = PyBaseObject_Type.tp_new +#define APPLY_ABSTRACT_FLAG(tp) tp->tp_new = PyBaseObject_Type.tp_new // REMME /* Accompagne la création d'une instance dérivée en Python. */ -PyObject *python_constructor_with_dynamic_gtype(PyTypeObject *, GType, PyObject *, PyObject *); - -/* Accompagne la création d'une instance dérivée en Python. */ -PyObject *python_abstract_constructor_with_dynamic_gtype(PyTypeObject *, GType, GClassInitFunc, PyObject *, PyObject *); +PyObject *python_abstract_constructor(PyTypeObject *, GType, GClassInitFunc, PyObject *, PyObject *); #define CREATE_DYN_CONSTRUCTOR(pyname, gbase) \ @@ -167,7 +164,7 @@ static PyObject *py_ ## pyname ## _new(PyTypeObject *, PyObject *, PyObject *); static PyObject *py_ ## pyname ## _new(PyTypeObject *type, PyObject *args, PyObject *kwds) \ { \ PyObject *result; /* Objet à retourner */ \ - result = python_constructor_with_dynamic_gtype(type, gbase, args, kwds); \ + result = PyType_GenericNew(type, args, kwds); \ return result; \ } @@ -177,8 +174,7 @@ static PyObject *py_ ## pyname ## _new(PyTypeObject *, PyObject *, PyObject *); static PyObject *py_ ## pyname ## _new(PyTypeObject *type, PyObject *args, PyObject *kwds) \ { \ PyObject *result; /* Objet à retourner */ \ - result = python_abstract_constructor_with_dynamic_gtype(type, gbase, (GClassInitFunc)cinit, \ - args, kwds); \ + result = python_abstract_constructor(type, gbase, (GClassInitFunc)cinit, args, kwds); \ return result; \ } |