summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/format/symbol.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysa/format/symbol.c')
-rw-r--r--plugins/pychrysa/format/symbol.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/plugins/pychrysa/format/symbol.c b/plugins/pychrysa/format/symbol.c
index 1fc868e..27674e0 100644
--- a/plugins/pychrysa/format/symbol.c
+++ b/plugins/pychrysa/format/symbol.c
@@ -693,28 +693,18 @@ PyTypeObject *get_python_binary_symbol_type(void)
bool register_python_binary_symbol(PyObject *module)
{
PyTypeObject *py_bin_symbol_type; /* Type Python 'BinSymbol' */
- int ret; /* Bilan d'un appel */
PyObject *dict; /* Dictionnaire du module */
py_bin_symbol_type = get_python_binary_symbol_type();
- py_bin_symbol_type->tp_base = &PyGObject_Type;
- py_bin_symbol_type->tp_basicsize = py_bin_symbol_type->tp_base->tp_basicsize;
+ dict = PyModule_GetDict(module);
- if (PyType_Ready(py_bin_symbol_type) != 0)
+ if (!register_class_for_pygobject(dict, G_TYPE_BIN_SYMBOL, py_bin_symbol_type, &PyGObject_Type))
return false;
if (!py_binary_symbol_define_constants(py_bin_symbol_type))
return false;
- Py_INCREF(py_bin_symbol_type);
- ret = PyModule_AddObject(module, "BinSymbol", (PyObject *)py_bin_symbol_type);
- if (ret != 0) return false;
-
- dict = PyModule_GetDict(module);
- pygobject_register_class(dict, "BinSymbol", G_TYPE_BIN_SYMBOL, py_bin_symbol_type,
- Py_BuildValue("(O)", py_bin_symbol_type->tp_base));
-
return true;
}