From: Mike Bayer Date: Sun, 12 Oct 2014 23:37:14 +0000 (-0400) Subject: - the test_except test was doing an unnecessary workaround of some kind, X-Git-Tag: rel_1_0_0b1~70^2~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0426d174e4a608cb09878fe18185b2ae853243ad;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - the test_except test was doing an unnecessary workaround of some kind, take that out, restore the better exception logic in exc --- diff --git a/lib/sqlalchemy/exc.py b/lib/sqlalchemy/exc.py index 8e65ef07b2..5d35dc2e7a 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 a623827257..359473c54e 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):