diff options
author | Owen Nelson <onelson@gmail.com> | 2012-12-28 20:20:23 -0500 |
---|---|---|
committer | Owen Nelson <onelson@gmail.com> | 2012-12-28 20:20:23 -0500 |
commit | 16ab0d61ef7e3e324bec71a672983384eba48389 (patch) | |
tree | 370bac36b343423e6d4c1de55dbb66a2d54716cb /lib/sqlalchemy/dialects/mysql/gaerdbms.py | |
parent | 989f11b4fc55dbd29ea1184e5d7abe2661e145d6 (diff) | |
download | sqlalchemy-16ab0d61ef7e3e324bec71a672983384eba48389.tar.gz |
Fixes issue where GAE error handling can cause AttributeError: 'NoneType' object has no attribute 'group'
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/gaerdbms.py')
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/gaerdbms.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/gaerdbms.py b/lib/sqlalchemy/dialects/mysql/gaerdbms.py index 54444204e..5972b2177 100644 --- a/lib/sqlalchemy/dialects/mysql/gaerdbms.py +++ b/lib/sqlalchemy/dialects/mysql/gaerdbms.py @@ -50,7 +50,9 @@ class MySQLDialect_gaerdbms(MySQLDialect_mysqldb): def _extract_error_code(self, exception): match = re.compile(r"^(\d+):").match(str(exception)) - code = match.group(1) + # The rdbms api will wrap then re-raise some types of errors + # making this regex return no matches. + code = match.group(1) if match else None if code: return int(code) |