mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 19:31:54 +08:00
Fix MySQLdb1-1 Exception format incompatible with previous versions
Unfortunately, when I broke this, I broke the test at the same time. That should have been a red flag.
This commit is contained in:
@ -33,7 +33,7 @@ def defaulterrorhandler(connection, cursor, errorclass, errorvalue):
|
|||||||
connection.messages.append(error)
|
connection.messages.append(error)
|
||||||
del cursor
|
del cursor
|
||||||
del connection
|
del connection
|
||||||
raise errorclass(errorvalue)
|
raise errorclass, errorvalue
|
||||||
|
|
||||||
re_numeric_part = re.compile(r"^(\d+)")
|
re_numeric_part = re.compile(r"^(\d+)")
|
||||||
|
|
||||||
|
@ -77,8 +77,8 @@ class test_MySQLdb(capabilities.DatabaseTest):
|
|||||||
from MySQLdb.constants import ER
|
from MySQLdb.constants import ER
|
||||||
try:
|
try:
|
||||||
self.cursor.execute("describe some_non_existent_table");
|
self.cursor.execute("describe some_non_existent_table");
|
||||||
except self.connection.ProgrammingError as msg:
|
except self.connection.ProgrammingError, msg:
|
||||||
self.assertTrue(msg.args[0].args[0] == ER.NO_SUCH_TABLE)
|
self.assertTrue(msg[0] == ER.NO_SUCH_TABLE)
|
||||||
|
|
||||||
def test_bug_3514287(self):
|
def test_bug_3514287(self):
|
||||||
c = self.cursor
|
c = self.cursor
|
||||||
|
Reference in New Issue
Block a user