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)
|
||||
del cursor
|
||||
del connection
|
||||
raise errorclass(errorvalue)
|
||||
raise errorclass, errorvalue
|
||||
|
||||
re_numeric_part = re.compile(r"^(\d+)")
|
||||
|
||||
|
@ -77,8 +77,8 @@ class test_MySQLdb(capabilities.DatabaseTest):
|
||||
from MySQLdb.constants import ER
|
||||
try:
|
||||
self.cursor.execute("describe some_non_existent_table");
|
||||
except self.connection.ProgrammingError as msg:
|
||||
self.assertTrue(msg.args[0].args[0] == ER.NO_SUCH_TABLE)
|
||||
except self.connection.ProgrammingError, msg:
|
||||
self.assertTrue(msg[0] == ER.NO_SUCH_TABLE)
|
||||
|
||||
def test_bug_3514287(self):
|
||||
c = self.cursor
|
||||
|
Reference in New Issue
Block a user