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/arch | |
parent | edcd7a2e2919ea880f8aaf649cf7ed8f1eabac1a (diff) |
Registered basic Python objects in the features namespace.
Diffstat (limited to 'plugins/pychrysalide/arch')
-rw-r--r-- | plugins/pychrysalide/arch/instriter.c | 7 | ||||
-rw-r--r-- | plugins/pychrysalide/arch/vmpa.c | 12 |
2 files changed, 4 insertions, 15 deletions
diff --git a/plugins/pychrysalide/arch/instriter.c b/plugins/pychrysalide/arch/instriter.c index f665cba..9b149fd 100644 --- a/plugins/pychrysalide/arch/instriter.c +++ b/plugins/pychrysalide/arch/instriter.c @@ -33,6 +33,7 @@ #include "processor.h" #include "../access.h" +#include "../helpers.h" @@ -263,7 +264,6 @@ bool ensure_python_instr_iterator_is_registered(void) { PyTypeObject *type; /* Type Python 'InstrIterator' */ PyObject *module; /* Module à recompléter */ - int ret; /* Bilan d'un appel */ type = get_python_instr_iterator_type(); @@ -274,10 +274,7 @@ bool ensure_python_instr_iterator_is_registered(void) module = get_access_to_python_module("pychrysalide.arch"); - Py_INCREF(type); - ret = PyModule_AddObject(module, "InstrIterator", (PyObject *)type); - - if (ret != 0) + if (!register_python_module_object(module, type)) return false; } diff --git a/plugins/pychrysalide/arch/vmpa.c b/plugins/pychrysalide/arch/vmpa.c index cdf20c9..f2450bb 100644 --- a/plugins/pychrysalide/arch/vmpa.c +++ b/plugins/pychrysalide/arch/vmpa.c @@ -662,7 +662,6 @@ bool ensure_python_vmpa_is_registered(void) { PyTypeObject *type; /* Type Python pour 'vmpa' */ PyObject *module; /* Module à recompléter */ - int ret; /* Bilan d'un appel */ type = get_python_vmpa_type(); @@ -676,10 +675,7 @@ bool ensure_python_vmpa_is_registered(void) module = get_access_to_python_module("pychrysalide.arch"); - Py_INCREF(type); - ret = PyModule_AddObject(module, "vmpa", (PyObject *)type); - - if (ret != 0) + if (!register_python_module_object(module, type)) return false; } @@ -1260,7 +1256,6 @@ bool ensure_python_mrange_is_registered(void) { PyTypeObject *type; /* Type Python pour 'mrange' */ PyObject *module; /* Module à recompléter */ - int ret; /* Bilan d'un appel */ type = get_python_mrange_type(); @@ -1271,10 +1266,7 @@ bool ensure_python_mrange_is_registered(void) module = get_access_to_python_module("pychrysalide.arch"); - Py_INCREF(type); - ret = PyModule_AddObject(module, "mrange", (PyObject *)type); - - if (ret != 0) + if (!register_python_module_object(module, type)) return false; } |