Python 3: Fix the pygobject init macro and restore it
This commit is contained in:
parent
efc5429cfc
commit
8938f87220
|
@ -21,11 +21,8 @@ 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);
|
||||
|
@ -33,11 +30,8 @@ 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);
|
||||
|
|
|
@ -575,8 +575,7 @@ static PyGetSetDef PyGObjectPtr_getseters[] = {
|
|||
|
||||
|
||||
static PyTypeObject PyGObjectPtrType = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
0, /* ob_size */
|
||||
PyVarObject_HEAD_INIT(NULL, 0 /* ob_size */)
|
||||
"_lasso.PyGObjectPtr", /* tp_name */
|
||||
sizeof(PyGObjectPtr), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
|
|
Loading…
Reference in New Issue