# HG changeset patch # User Sylvain Thénault # Date 1475247813 -7200 # Node ID c6d37774f4d018681f616cf9168ea35f6e571c3d # Parent 9a6a8a68372833544d4acf2b20806ebb152fd4e4 [devtools] Properly reraise the exception with previous implementation, the original exception wasn't visible in python 2. diff -r 9a6a8a683728 -r c6d37774f4d0 cubicweb/devtools/testlib.py --- a/cubicweb/devtools/testlib.py Mon Oct 24 14:41:36 2016 +0200 +++ b/cubicweb/devtools/testlib.py Fri Sep 30 17:03:33 2016 +0200 @@ -28,7 +28,7 @@ from itertools import chain import tempfile -from six import text_type, string_types +from six import text_type, string_types, reraise from six.moves import range from six.moves.urllib.parse import urlparse, parse_qs, unquote as urlunquote @@ -981,9 +981,7 @@ msg = '[%s in %s] %s' % (klass, view.__regid__, exc) except Exception: msg = '[%s in %s] undisplayable exception' % (klass, view.__regid__) - exc = AssertionError(msg) - exc.__traceback__ = tcbk - raise exc + reraise(AssertionError, AssertionError(msg), sys.exc_info()[-1]) return self._check_html(output, view, template) def get_validator(self, view=None, content_type=None, output=None):