From 44ebac8a36467f2ad65cd40b906c576e4aca0330 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sat, 24 Sep 2011 04:15:40 -0400 Subject: take advantage of as-syntax --- pyramid/tweens.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyramid/tweens.py b/pyramid/tweens.py index e40f5102f..65d7c3919 100644 --- a/pyramid/tweens.py +++ b/pyramid/tweens.py @@ -15,11 +15,11 @@ def excview_tween_factory(handler, registry): attrs = request.__dict__ try: response = handler(request) - except Exception: + except Exception as exc: # WARNING: do not assign the result of sys.exc_info() to a # local var here, doing so will cause a leak attrs['exc_info'] = sys.exc_info() - exc = attrs['exception'] = attrs['exc_info'][1] + attrs['exception'] = exc # clear old generated request.response, if any; it may # have been mutated by the view, and its state is not # sane (e.g. caching headers) -- cgit v1.2.3