summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/mangling/demangler.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/mangling/demangler.c')
-rw-r--r--plugins/pychrysalide/mangling/demangler.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/plugins/pychrysalide/mangling/demangler.c b/plugins/pychrysalide/mangling/demangler.c
index 37935c9..15c9c62 100644
--- a/plugins/pychrysalide/mangling/demangler.c
+++ b/plugins/pychrysalide/mangling/demangler.c
@@ -31,6 +31,7 @@
#include <mangling/demangler.h>
+#include "../access.h"
#include "../helpers.h"
@@ -202,17 +203,24 @@ PyTypeObject *get_python_compiler_demangler_type(void)
* *
******************************************************************************/
-bool register_python_compiler_demangler(PyObject *module)
+bool ensure_python_compiler_demangler_is_registered(void)
{
- PyTypeObject *py_comp_demangler_type; /* Type Python 'CompDemangler' */
+ PyTypeObject *type; /* Type Python 'CompDemangler' */
+ PyObject *module; /* Module à recompléter */
PyObject *dict; /* Dictionnaire du module */
- py_comp_demangler_type = get_python_compiler_demangler_type();
+ type = get_python_compiler_demangler_type();
- dict = PyModule_GetDict(module);
+ if (!PyType_HasFeature(type, Py_TPFLAGS_READY))
+ {
+ module = get_access_to_python_module("pychrysalide.mangling");
+
+ dict = PyModule_GetDict(module);
- if (!register_class_for_pygobject(dict, G_TYPE_COMP_DEMANGLER, py_comp_demangler_type, &PyGObject_Type))
- return false;
+ if (!register_class_for_pygobject(dict, G_TYPE_COMP_DEMANGLER, type, &PyGObject_Type))
+ return false;
+
+ }
return true;