From: Mike Bayer Date: Sun, 12 Oct 2014 13:54:44 +0000 (-0400) Subject: - roll back part of pr 140 to get exception wrapping working again X-Git-Tag: rel_1_0_0b1~70^2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d5c03001cd81d9ad5cee2459f222a6319f5b956;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - roll back part of pr 140 to get exception wrapping working again --- diff --git a/lib/sqlalchemy/exc.py b/lib/sqlalchemy/exc.py index 5d35dc2e7a..8e65ef07b2 100644 --- a/lib/sqlalchemy/exc.py +++ b/lib/sqlalchemy/exc.py @@ -280,9 +280,13 @@ class DBAPIError(StatementError): connection_invalidated=False): # Don't ever wrap these, just return them directly as if # DBAPIError didn't exist. - if (isinstance(orig, BaseException) and - not isinstance(orig, Exception)) or \ - isinstance(orig, DontWrapMixin): + 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): return orig if orig is not None: