diff options
author | Hajime Nakagami <nakagami@gmail.com> | 2013-02-26 00:30:27 +0900 |
---|---|---|
committer | Hajime Nakagami <nakagami@gmail.com> | 2013-02-26 00:30:27 +0900 |
commit | 7bb5f463dfeb39b8ba84a63147756d27901a2f56 (patch) | |
tree | cfc50b811e2d234d1bb7aad5781582e75a5b468e /lib/sqlalchemy/dialects/mysql/cymysql.py | |
parent | 105c991c897cb26db8a3d49ee168b44daf6b6adf (diff) | |
download | sqlalchemy-7bb5f463dfeb39b8ba84a63147756d27901a2f56.tar.gz |
fix cymysql's _extact_error_code() for py3
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/cymysql.py')
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/cymysql.py | 5 |
1 files changed, 4 insertions, 1 deletions
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 |