From 87efa7ee5588f5d8474ed62366118ab5c9adc5a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Houz=C3=A9fa=20Abbasbhay?= Date: Mon, 1 Dec 2014 15:05:44 +0100 Subject: [PATCH] Python 3: Disable "PyGObjectPtrType" to avoid crashes (needs investigation) --- bindings/python/wrapper_bottom.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bindings/python/wrapper_bottom.c b/bindings/python/wrapper_bottom.c index 30971b10..9f1157a6 100644 --- a/bindings/python/wrapper_bottom.c +++ b/bindings/python/wrapper_bottom.c @@ -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);