diff options
Diffstat (limited to 'plugins/pychrysalide/common')
-rw-r--r-- | plugins/pychrysalide/common/bits.c | 6 | ||||
-rw-r--r-- | plugins/pychrysalide/common/fnv1a.c | 9 | ||||
-rw-r--r-- | plugins/pychrysalide/common/pathname.c | 7 |
3 files changed, 6 insertions, 16 deletions
diff --git a/plugins/pychrysalide/common/bits.c b/plugins/pychrysalide/common/bits.c index 62aeb6d..7a6454d 100644 --- a/plugins/pychrysalide/common/bits.c +++ b/plugins/pychrysalide/common/bits.c @@ -762,7 +762,6 @@ bool ensure_python_bitfield_is_registered(void) { PyTypeObject *type; /* Type Python pour 'bitfield' */ PyObject *module; /* Module à recompléter */ - int ret; /* Bilan d'un appel */ type = get_python_bitfield_type(); @@ -773,10 +772,7 @@ bool ensure_python_bitfield_is_registered(void) module = get_access_to_python_module("pychrysalide.common"); - Py_INCREF(type); - ret = PyModule_AddObject(module, "bitfield", (PyObject *)type); - - if (ret != 0) + if (!register_python_module_object(module, type)) return false; } diff --git a/plugins/pychrysalide/common/fnv1a.c b/plugins/pychrysalide/common/fnv1a.c index 759c7ea..5caad48 100644 --- a/plugins/pychrysalide/common/fnv1a.c +++ b/plugins/pychrysalide/common/fnv1a.c @@ -32,6 +32,7 @@ #include "../access.h" +#include "../helpers.h" @@ -130,9 +131,8 @@ PyTypeObject *get_python_fnv1a_type(void) bool ensure_python_fnv1a_is_registered(void) { - PyTypeObject *type; /* Type Python pour 'fnv1a' */ + PyTypeObject *type; /* Type Python pour 'fnv1a' */ PyObject *module; /* Module à recompléter */ - int ret; /* Bilan d'un appel */ type = get_python_fnv1a_type(); @@ -145,10 +145,7 @@ bool ensure_python_fnv1a_is_registered(void) module = get_access_to_python_module("pychrysalide.common"); - Py_INCREF(type); - ret = PyModule_AddObject(module, "fnv1a", (PyObject *)type); - - if (ret != 0) + if (!register_python_module_object(module, type)) return false; } diff --git a/plugins/pychrysalide/common/pathname.c b/plugins/pychrysalide/common/pathname.c index c2d69c6..e07ebe5 100644 --- a/plugins/pychrysalide/common/pathname.c +++ b/plugins/pychrysalide/common/pathname.c @@ -36,6 +36,7 @@ #include "../access.h" +#include "../helpers.h" @@ -190,7 +191,6 @@ bool ensure_python_pathname_is_registered(void) { PyTypeObject *type; /* Type Python pour 'pathname' */ PyObject *module; /* Module à recompléter */ - int ret; /* Bilan d'un appel */ type = get_python_pathname_type(); @@ -203,10 +203,7 @@ bool ensure_python_pathname_is_registered(void) module = get_access_to_python_module("pychrysalide.common"); - Py_INCREF(type); - ret = PyModule_AddObject(module, "pathname", (PyObject *)type); - - if (ret != 0) + if (!register_python_module_object(module, type)) return false; } |