mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-06-16 21:50:40 -04:00
fix cymysql's _extact_error_code() for py3
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user