mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 11:10:58 +08:00
_mysql imports now, but still crashes
This commit is contained in:
@ -3018,8 +3018,10 @@ init_mysql(void)
|
|||||||
(PyObject *)&_mysql_ResultObject_Type))
|
(PyObject *)&_mysql_ResultObject_Type))
|
||||||
goto error;
|
goto error;
|
||||||
Py_INCREF(&_mysql_ResultObject_Type);
|
Py_INCREF(&_mysql_ResultObject_Type);
|
||||||
if (!(emod = PyImport_ImportModule("_mysql_exceptions")))
|
if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
|
||||||
|
PyErr_Print();
|
||||||
goto error;
|
goto error;
|
||||||
|
}
|
||||||
if (!(edict = PyModule_GetDict(emod))) goto error;
|
if (!(edict = PyModule_GetDict(emod))) goto error;
|
||||||
if (!(_mysql_MySQLError =
|
if (!(_mysql_MySQLError =
|
||||||
_mysql_NewException(dict, edict, "MySQLError")))
|
_mysql_NewException(dict, edict, "MySQLError")))
|
||||||
|
@ -5,7 +5,12 @@ These classes are dictated by the DB API v2.0:
|
|||||||
http://www.python.org/topics/database/DatabaseAPI-2.0.html
|
http://www.python.org/topics/database/DatabaseAPI-2.0.html
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from exceptions import Exception, StandardError, Warning
|
try:
|
||||||
|
from exceptions import Exception, StandardError, Warning
|
||||||
|
except ImportError:
|
||||||
|
# Python 3
|
||||||
|
StandardError = Exception
|
||||||
|
|
||||||
|
|
||||||
class MySQLError(StandardError):
|
class MySQLError(StandardError):
|
||||||
|
|
||||||
@ -80,4 +85,3 @@ class NotSupportedError(DatabaseError):
|
|||||||
has transactions turned off."""
|
has transactions turned off."""
|
||||||
|
|
||||||
|
|
||||||
del Exception, StandardError
|
|
||||||
|
Reference in New Issue
Block a user