summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/cymysql.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/cymysql.py')
-rw-r--r--lib/sqlalchemy/dialects/mysql/cymysql.py5
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