diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-12-12 17:02:49 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-12-12 17:02:49 (GMT) |
commit | d5b598b14fd4c50847ce536692ded258ba1720ca (patch) | |
tree | bee74e8bcdd642bf67103529991be9d587c6d1da /plugins/pychrysalide/struct.c | |
parent | edcd7a2e2919ea880f8aaf649cf7ed8f1eabac1a (diff) |
Registered basic Python objects in the features namespace.
Diffstat (limited to 'plugins/pychrysalide/struct.c')
-rw-r--r-- | plugins/pychrysalide/struct.c | 11 |
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; } |