# HG changeset patch # User adustman # Date 1236534634 0 # Node ID 7fe4b0b37e8e4d7f97b0c3dfb5ae040aad84a843 # Parent 8506ded95181228c7a850be87ec3c552c0e8c588 Fix #2671682. (from 1.2 branch) diff -r 8506ded95181 -r 7fe4b0b37e8e MySQLdb/connections.py --- a/MySQLdb/connections.py Sun Mar 08 16:02:16 2009 +0000 +++ b/MySQLdb/connections.py Sun Mar 08 17:50:34 2009 +0000 @@ -29,7 +29,7 @@ connection.messages.append(error) del cursor del connection - raise errorclass(errorvalue) + raise errorclass, errorvalue class Connection(object): diff -r 8506ded95181 -r 7fe4b0b37e8e tests/test_MySQLdb_capabilities.py --- a/tests/test_MySQLdb_capabilities.py Sun Mar 08 16:02:16 2009 +0000 +++ b/tests/test_MySQLdb_capabilities.py Sun Mar 08 17:50:34 2009 +0000 @@ -73,7 +73,15 @@ self.check_data_integrity( ('col1 char(1)','col2 char(1)'), generator) - + + def test_bug_2671682(self): + from MySQLdb.constants import ER + try: + self.cursor.execute("describe some_non_existent_table"); + except self.connection.ProgrammingError, msg: + self.failUnless(msg[0] == ER.NO_SUCH_TABLE) + + if __name__ == '__main__': if test_MySQLdb.leak_test: import gc