mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-16 12:27:03 +08:00
call mysql_library_init in module initialization (#377)
This commit is contained in:
@ -2643,6 +2643,15 @@ init_mysql(void)
|
|||||||
{
|
{
|
||||||
PyObject *dict, *module, *emod, *edict;
|
PyObject *dict, *module, *emod, *edict;
|
||||||
|
|
||||||
|
if (mysql_library_init(0, NULL, NULL)) {
|
||||||
|
PyErr_SetString(PyExc_ImportError, "_mysql: mysql_library_init failed");
|
||||||
|
#ifdef IS_PY3K
|
||||||
|
return NULL;
|
||||||
|
#else
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef IS_PY3K
|
#ifdef IS_PY3K
|
||||||
if (PyType_Ready(&_mysql_ConnectionObject_Type) < 0)
|
if (PyType_Ready(&_mysql_ConnectionObject_Type) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user