From 7bb5f463dfeb39b8ba84a63147756d27901a2f56 Mon Sep 17 00:00:00 2001 From: Hajime Nakagami Date: Tue, 26 Feb 2013 00:30:27 +0900 Subject: fix cymysql's _extact_error_code() for py3 --- lib/sqlalchemy/dialects/mysql/cymysql.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/dialects/mysql/cymysql.py') diff --git a/lib/sqlalchemy/dialects/mysql/cymysql.py b/lib/sqlalchemy/dialects/mysql/cymysql.py index fb5de841f..1d6f97787 100644 --- a/lib/sqlalchemy/dialects/mysql/cymysql.py +++ b/lib/sqlalchemy/dialects/mysql/cymysql.py @@ -26,6 +26,9 @@ class MySQLDialect_cymysql(MySQLDialect_mysqldb): return __import__('cymysql') def _extract_error_code(self, exception): - return exception.args[0] + v = exception.args[0] + if not isinstance(v, int): + v = v.args[0] + return v dialect = MySQLDialect_cymysql -- cgit v1.2.1