summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/mysqldb.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2010-07-12 11:15:16 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2010-07-12 11:15:16 -0400
commit800448ad621a7cbe50726b6e208f55264dc623bc (patch)
tree56a0504e0c14c157e493e0ade28cccf052e542ce /lib/sqlalchemy/dialects/mysql/mysqldb.py
parent8f0ac7b5c968fac2cccd4f5bb7dcca927aff5f0b (diff)
downloadsqlalchemy-800448ad621a7cbe50726b6e208f55264dc623bc.tar.gz
- The _extract_error_code() method now works
correctly with the "mysqldb" dialect. Previously, the reconnect logic would fail for OperationalError conditions, however since MySQLdb has its own reconnect feature, there was no symptom here unless one watched the logs. [ticket:1848]
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/mysqldb.py')
-rw-r--r--lib/sqlalchemy/dialects/mysql/mysqldb.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/mysqldb.py b/lib/sqlalchemy/dialects/mysql/mysqldb.py
index 6e6bb0ecc..d43b62ce3 100644
--- a/lib/sqlalchemy/dialects/mysql/mysqldb.py
+++ b/lib/sqlalchemy/dialects/mysql/mysqldb.py
@@ -157,8 +157,10 @@ class MySQLDialect_mysqldb(MySQLDialect):
def _extract_error_code(self, exception):
try:
- return exception.orig.args[0]
+ return exception.args[0]
except AttributeError:
+ # this AttributeError is likely unnecessary,
+ # but would need to confirm against MySQLdb code
return None
def _detect_charset(self, connection):