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);