diff options
author | ndparker <ndparker@users.noreply.github.com> | 2014-10-02 22:00:31 +0200 |
---|---|---|
committer | ndparker <ndparker@users.noreply.github.com> | 2014-10-02 22:00:31 +0200 |
commit | 690532131d8ce8250c62f1d3e27405902df03e70 (patch) | |
tree | 69ef40646aa14519b539ae9d09a16229b7b3e20a /lib/sqlalchemy/exc.py | |
parent | ce52dd9e3b71f2074d7821fe62803d4e0eefe512 (diff) | |
download | sqlalchemy-pr/140.tar.gz |
cleanup exception handling - use new exception hierarchy (since python 2.5)pr/140
Diffstat (limited to 'lib/sqlalchemy/exc.py')
-rw-r--r-- | lib/sqlalchemy/exc.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/exc.py b/lib/sqlalchemy/exc.py index a82bae33f..5d35dc2e7 100644 --- a/lib/sqlalchemy/exc.py +++ b/lib/sqlalchemy/exc.py @@ -280,7 +280,9 @@ class DBAPIError(StatementError): connection_invalidated=False): # Don't ever wrap these, just return them directly as if # DBAPIError didn't exist. - if isinstance(orig, (KeyboardInterrupt, SystemExit, DontWrapMixin)): + if (isinstance(orig, BaseException) and + not isinstance(orig, Exception)) or \ + isinstance(orig, DontWrapMixin): return orig if orig is not None: @@ -310,8 +312,6 @@ class DBAPIError(StatementError): def __init__(self, statement, params, orig, connection_invalidated=False): try: text = str(orig) - except (KeyboardInterrupt, SystemExit): - raise except Exception as e: text = 'Error in str() of DB-API-generated exception: ' + str(e) StatementError.__init__( |