diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-10-12 19:37:14 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-10-12 19:37:14 -0400 |
commit | 0426d174e4a608cb09878fe18185b2ae853243ad (patch) | |
tree | 4ceb884e1e0f73bd8aa96d6860a9747332ae8f4e | |
parent | 6d5c03001cd81d9ad5cee2459f222a6319f5b956 (diff) | |
download | sqlalchemy-0426d174e4a608cb09878fe18185b2ae853243ad.tar.gz |
- the test_except test was doing an unnecessary workaround of some kind,
take that out, restore the better exception logic in exc
-rw-r--r-- | lib/sqlalchemy/exc.py | 10 | ||||
-rw-r--r-- | test/base/test_except.py | 9 |
2 files changed, 4 insertions, 15 deletions
diff --git a/lib/sqlalchemy/exc.py b/lib/sqlalchemy/exc.py index 8e65ef07b..5d35dc2e7 100644 --- a/lib/sqlalchemy/exc.py +++ b/lib/sqlalchemy/exc.py @@ -280,13 +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)): - - # TODO: shouldn't it work this way? see if we can get this - # to work in py3k - #if (isinstance(orig, BaseException) and - # not isinstance(orig, Exception)) or \ - # isinstance(orig, DontWrapMixin): + if (isinstance(orig, BaseException) and + not isinstance(orig, Exception)) or \ + isinstance(orig, DontWrapMixin): return orig if orig is not None: diff --git a/test/base/test_except.py b/test/base/test_except.py index a62382725..359473c54 100644 --- a/test/base/test_except.py +++ b/test/base/test_except.py @@ -2,19 +2,12 @@ from sqlalchemy import exc as sa_exceptions -from sqlalchemy import util from sqlalchemy.testing import fixtures from sqlalchemy.testing import eq_ -if util.py2k: - from exceptions import StandardError, KeyboardInterrupt, SystemExit -else: - Exception = BaseException - class Error(Exception): - """This class will be old-style on <= 2.4 and new-style on >= - 2.5.""" + pass class DatabaseError(Error): |