summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/struct.c')
-rw-r--r--plugins/pychrysalide/struct.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/plugins/pychrysalide/struct.c b/plugins/pychrysalide/struct.c
index 98704c0..d4d6a9f 100644
--- a/plugins/pychrysalide/struct.c
+++ b/plugins/pychrysalide/struct.c
@@ -26,6 +26,7 @@
#include "access.h"
+#include "helpers.h"
@@ -147,7 +148,6 @@ bool ensure_python_py_struct_is_registered(void)
{
PyTypeObject *type; /* Type Python 'PyStructObject'*/
PyObject *module; /* Module à recompléter */
- int ret; /* Bilan des préparatifs */
type = get_python_py_struct_type();
@@ -155,14 +155,11 @@ bool ensure_python_py_struct_is_registered(void)
{
module = get_access_to_python_module("pychrysalide");
- ret = PyType_Ready(type);
-
- if (ret != 0)
+ if (PyType_Ready(type) != 0)
return false;
- Py_INCREF(type);
-
- PyModule_AddObject(module, "PyStructObject", (PyObject *)type);
+ if (!register_python_module_object(module, type))
+ return false;
}