Python 3: Disable "PyGObjectPtrType" to avoid crashes (needs

investigation)
This commit is contained in:
Houzéfa Abbasbhay 2014-12-01 15:05:44 +01:00 committed by Benjamin Dauvergne
parent 70b9d765bc
commit 87efa7ee55
1 changed files with 6 additions and 0 deletions

View File

@ -21,8 +21,11 @@ MOD_INIT(_lasso)
{
PyObject *m, *d;
#if PY_MAJOR_VERSION < 2
/// @todo Seg-faults on Python 3...
if (PyType_Ready(&PyGObjectPtrType) < 0)
return MOD_ERROR_VAL;
#endif
MOD_DEF(m, "_lasso", "_lasso wrapper module", lasso_methods);
d = PyModule_GetDict(m);
@ -30,8 +33,11 @@ MOD_INIT(_lasso)
lasso_wrapper_key = g_quark_from_static_string("PyLasso::wrapper");
#if PY_MAJOR_VERSION < 2
/// @todo Seg-faults on Python 3...
Py_INCREF(&PyGObjectPtrType);
PyModule_AddObject(m, "PyGObjectPtr", (PyObject *)&PyGObjectPtrType);
#endif
lasso_init();
lasso_log_set_handler(G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION | G_LOG_LEVEL_MASK,
lasso_python_log, NULL);