]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- the test_except test was doing an unnecessary workaround of some kind,
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 12 Oct 2014 23:37:14 +0000 (19:37 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 12 Oct 2014 23:37:14 +0000 (19:37 -0400)
take that out, restore the better exception logic in exc

lib/sqlalchemy/exc.py
test/base/test_except.py

index 8e65ef07b2bb5cf120943875eaee7972cd4c4f46..5d35dc2e7a6c51e0288374d657753503252d0941 100644 (file)
@@ -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:
index a6238272575cf6040cb0738082ff94a5ccf68900..359473c54edad5c2aad38e638e2964868e4203f4 100644 (file)
@@ -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):