]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
It now calls raise_from_cause
authorScott Dugas <scott.dugas@foundationdb.com>
Mon, 3 Nov 2014 20:24:31 +0000 (15:24 -0500)
committerScott Dugas <scott.dugas@foundationdb.com>
Mon, 3 Nov 2014 20:24:31 +0000 (15:24 -0500)
master was updated to call util.raise_from_cause which is better
than what I had

lib/sqlalchemy/testing/exclusions.py

index e3d91300dcfdb45535cad7d8553f3265fee8216d..f94724608aeb1ce7454c1db8835ddfc81b6dfa0a 100644 (file)
@@ -12,7 +12,6 @@ from ..util import decorator
 from . import config
 from .. import util
 import inspect
-import sys
 import contextlib
 
 
@@ -121,18 +120,17 @@ class compound(object):
 
         try:
             return_value = fn(*args, **kw)
-        except Exception:
-            exc_type, exc_value, exc_traceback = sys.exc_info()
-            self._expect_failure(config, exc_type, exc_value, exc_traceback, name=fn.__name__)
+        except Exception as ex:
+            self._expect_failure(config, ex, name=fn.__name__)
         else:
             self._expect_success(config, name=fn.__name__)
             return return_value
 
-    def _expect_failure(self, config, exc_type, exc_value, exc_traceback, name='block'):
+    def _expect_failure(self, config, ex, name='block'):
         for fail in self.fails:
             if fail(config):
                 print(("%s failed as expected (%s): %s " % (
-                    name, fail._as_string(config), str(exc_value))))
+                    name, fail._as_string(config), str(ex))))
                 break
         else:
             util.raise_from_cause(ex)