Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fe917fc

Browse filesBrowse files
author
adustman
committed
_mysql imports now, but still crashes
1 parent a5c7996 commit fe917fc
Copy full SHA for fe917fc

File tree

Expand file treeCollapse file tree

2 files changed

+9
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+9
-3
lines changed

‎MySQLdb/_mysql.c

Copy file name to clipboardExpand all lines: MySQLdb/_mysql.c
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3018,8 +3018,10 @@ init_mysql(void)
30183018
(PyObject *)&_mysql_ResultObject_Type))
30193019
goto error;
30203020
Py_INCREF(&_mysql_ResultObject_Type);
3021-
if (!(emod = PyImport_ImportModule("_mysql_exceptions")))
3021+
if (!(emod = PyImport_ImportModule("_mysql_exceptions"))) {
3022+
PyErr_Print();
30223023
goto error;
3024+
}
30233025
if (!(edict = PyModule_GetDict(emod))) goto error;
30243026
if (!(_mysql_MySQLError =
30253027
_mysql_NewException(dict, edict, "MySQLError")))

‎MySQLdb/_mysql_exceptions.py

Copy file name to clipboardExpand all lines: MySQLdb/_mysql_exceptions.py
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
http://www.python.org/topics/database/DatabaseAPI-2.0.html
66
"""
77

8-
from exceptions import Exception, StandardError, Warning
8+
try:
9+
from exceptions import Exception, StandardError, Warning
10+
except ImportError:
11+
# Python 3
12+
StandardError = Exception
13+
914

1015
class MySQLError(StandardError):
1116

@@ -80,4 +85,3 @@ class NotSupportedError(DatabaseError):
8085
has transactions turned off."""
8186

8287

83-
del Exception, StandardError

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.