diff MySQLdb/connections.py @ 35:e7bd07afbcb9 MySQLdb

Conflict-filled merge from 1.2br for 558:559 set and exception fixes
author kylev
date Thu, 12 Feb 2009 00:23:41 +0000
parents 597efa4e0311
children 4093fb968cb7
line wrap: on
line diff
--- a/MySQLdb/connections.py	Thu Feb 12 00:08:30 2009 +0000
+++ b/MySQLdb/connections.py	Thu Feb 12 00:23:41 2009 +0000
@@ -29,7 +29,7 @@
         connection.messages.append(error)
     del cursor
     del connection
-    raise errorclass, errorvalue
+    raise errorclass(errorvalue)
 
 
 class Connection(object):
@@ -284,7 +284,7 @@
                 self._db.set_character_set(charset)
             except AttributeError:
                 if self._server_version < (4, 1):
-                    raise self.NotSupportedError, "server is too old to set charset"
+                    raise self.NotSupportedError("server is too old to set charset")
                 self._db.query('SET NAMES %s' % charset)
                 self._db.store_result()
         self.string_decoder.charset = charset
@@ -297,7 +297,7 @@
         Non-standard. It is better to set this when creating the connection
         using the sql_mode parameter."""
         if self._server_version < (4, 1):
-            raise self.NotSupportedError, "server is too old to set sql_mode"
+            raise self.NotSupportedError("server is too old to set sql_mode")
         self._db.query("SET SESSION sql_mode='%s'" % sql_mode)
         self._db.store_result()