mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 02:54:29 +08:00
Fix segfault on Python 2.
This commit is contained in:
2
_mysql.c
2
_mysql.c
@ -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 */
|
||||||
|
Reference in New Issue
Block a user