From 68299cbd444d4ba1c837b9407faedb5dc42f9d16 Mon Sep 17 00:00:00 2001 From: Ben Trofatter Date: Mon, 18 Mar 2013 17:58:41 -0700 Subject: Added workaround for pymysql3 double wrapping ProgrammingErrors to pymysql dialect. Added workaround for pymysql3 return a bytes object when queried for isolation level. --- lib/sqlalchemy/dialects/mysql/pymysql.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/sqlalchemy/dialects/mysql/pymysql.py') diff --git a/lib/sqlalchemy/dialects/mysql/pymysql.py b/lib/sqlalchemy/dialects/mysql/pymysql.py index d70e997f7..25e2dadd3 100644 --- a/lib/sqlalchemy/dialects/mysql/pymysql.py +++ b/lib/sqlalchemy/dialects/mysql/pymysql.py @@ -28,9 +28,21 @@ class MySQLDialect_pymysql(MySQLDialect_mysqldb): driver = 'pymysql' description_encoding = None + # Py3K + #supports_unicode_statements = True + # Py2K + # end Py2K @classmethod def dbapi(cls): return __import__('pymysql') + # Py3K + #def _extract_error_code(self, exception): + # if isinstance(exception.args[0], Exception): + # exception = exception.args[0] + # return exception.args[0] + # Py2K + # end Py2K + dialect = MySQLDialect_pymysql -- cgit v1.2.1