Chris McDonough
2016-02-10 ca529f0d7d3870d851181375f6a15805cef208b5
bring into line with excview
1 files modified
15 ■■■■ changed files
pyramid/view.py 15 ●●●● patch | view | raw | blame | history
pyramid/view.py
@@ -596,10 +596,17 @@
            registry = get_current_registry()
        if exc_info is None:
            exc_info = traceback.exc_info()
        attrs = request.__dict__
        context_iface = providedBy(exc_info[0])
        view_name = getattr(request, 'view_name', '')
        request.exception = exc_info[0]
        request.exc_info = exc_info
        view_name = attrs.get('view_name', '')
        # probably need something like "with temporarily_munged_request(req)"
        # here, which adds exception and exc_info as request attrs, and
        # removes response object temporarily (as per the excview tween)
        attrs['exception'] = exc_info[0]
        attrs['exc_info'] = request.exc_info = exc_info
        # we use .get instead of .__getitem__ below due to
        # https://github.com/Pylons/pyramid/issues/700
        request_iface = attrs.get('request_iface', IRequest)
        response = _call_view(
            registry,
            request,
@@ -609,6 +616,6 @@
            view_types=None,
            view_classifier=IExceptionViewClassifier,
            secure=secure,
            request_iface=None,
            request_iface=request_iface.combined,
            )
        return response