diff options
Diffstat (limited to 'plugins/pychrysalide/arch/targetableop.c')
-rw-r--r-- | plugins/pychrysalide/arch/targetableop.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/plugins/pychrysalide/arch/targetableop.c b/plugins/pychrysalide/arch/targetableop.c index 8951492..0fb23e0 100644 --- a/plugins/pychrysalide/arch/targetableop.c +++ b/plugins/pychrysalide/arch/targetableop.c @@ -37,6 +37,7 @@ #include "processor.h" #include "vmpa.h" +#include "../access.h" #include "../format/format.h" @@ -163,15 +164,22 @@ PyTypeObject *get_python_targetable_operand_type(void) * * ******************************************************************************/ -bool register_python_targetable_operand(PyObject *module) +bool ensure_python_targetable_operand_is_registered(void) { - PyTypeObject *py_targetable_operand_type; /* Type 'TargetableOperand' */ + PyTypeObject *type; /* Type 'TargetableOperand' */ + PyObject *module; /* Module à recompléter */ PyObject *dict; /* Dictionnaire du module */ - py_targetable_operand_type = get_python_targetable_operand_type(); + type = get_python_targetable_operand_type(); - dict = PyModule_GetDict(module); - pyg_register_interface(dict, "TargetableOperand", G_TYPE_TARGETABLE_OPERAND, py_targetable_operand_type); + if (!PyType_HasFeature(type, Py_TPFLAGS_READY)) + { + module = get_access_to_python_module("pychrysalide.arch"); + + dict = PyModule_GetDict(module); + pyg_register_interface(dict, "TargetableOperand", G_TYPE_TARGETABLE_OPERAND, type); + + } return true; |