diff options
Diffstat (limited to 'plugins/pychrysa/analysis/block.c')
-rw-r--r-- | plugins/pychrysa/analysis/block.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/plugins/pychrysa/analysis/block.c b/plugins/pychrysa/analysis/block.c index 4cbc353..3ee7fcd 100644 --- a/plugins/pychrysa/analysis/block.c +++ b/plugins/pychrysa/analysis/block.c @@ -257,28 +257,18 @@ PyTypeObject *get_python_instr_block_type(void) bool register_python_instr_block(PyObject *module) { PyTypeObject *py_instr_block_type; /* Type Python 'InstrBlock' */ - int ret; /* Bilan d'un appel */ PyObject *dict; /* Dictionnaire du module */ py_instr_block_type = get_python_instr_block_type(); - py_instr_block_type->tp_base = &PyGObject_Type; - py_instr_block_type->tp_basicsize = py_instr_block_type->tp_base->tp_basicsize; + dict = PyModule_GetDict(module); - if (PyType_Ready(py_instr_block_type) != 0) + if (!register_class_for_pygobject(dict, G_TYPE_INSTR_BLOCK, py_instr_block_type, &PyGObject_Type)) return false; if (!py_instructions_block_define_constants(py_instr_block_type)) return false; - Py_INCREF(py_instr_block_type); - ret = PyModule_AddObject(module, "InstrBlock", (PyObject *)py_instr_block_type); - if (ret != 0) return false; - - dict = PyModule_GetDict(module); - pygobject_register_class(dict, "InstrBlock", G_TYPE_INSTR_BLOCK, py_instr_block_type, - Py_BuildValue("(O)", py_instr_block_type->tp_base)); - return true; } |