Fix segfault on Python 2.

This commit is contained in:
INADA Naoki
2014-04-17 00:44:43 +09:00
parent 690e5e9325
commit 80f5a4a66f

View File

@ -2997,6 +2997,8 @@ init_mysql(void)
module = PyModule_Create(&_mysqlmodule); module = PyModule_Create(&_mysqlmodule);
if (!module) return module; /* this really should never happen */ if (!module) return module; /* this really should never happen */
#else #else
_mysql_ConnectionObject_Type.tp_free = _PyObject_GC_Del;
_mysql_ResultObject_Type.tp_free = _PyObject_GC_Del;
module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__, module = Py_InitModule4("_mysql", _mysql_methods, _mysql___doc__,
(PyObject *)NULL, PYTHON_API_VERSION); (PyObject *)NULL, PYTHON_API_VERSION);
if (!module) return; /* this really should never happen */ if (!module) return; /* this really should never happen */