summaryrefslogtreecommitdiff
path: root/webob/request.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-09-22 04:07:46 -0400
committerChris McDonough <chrism@plope.com>2011-09-22 04:07:46 -0400
commiteeac83d7747a8b10e4d6406d16fa4c62740dece8 (patch)
tree2ac1e7e33ed2565d244f7ba0fb9c2f7f765c50e9 /webob/request.py
parent6f48fc8ef0fc3cb60ca45b3476248f8a49989542 (diff)
downloadwebob-eeac83d7747a8b10e4d6406d16fa4c62740dece8.tar.gz
in-the-wild code (webtest) depends on being able to call get_response with catch_exc_info=True
Diffstat (limited to 'webob/request.py')
-rw-r--r--webob/request.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/webob/request.py b/webob/request.py
index d696b4d..3d58b73 100644
--- a/webob/request.py
+++ b/webob/request.py
@@ -1070,7 +1070,7 @@ class BaseRequest(object):
# Will be filled in later:
ResponseClass = None
- def get_response(self, application):
+ def get_response(self, application, catch_exc_info=False):
"""
Like ``.call_application(application)``, except returns a
response object with ``.status``, ``.headers``, and ``.body``
@@ -1079,12 +1079,15 @@ class BaseRequest(object):
This will use ``self.ResponseClass`` to figure out the class
of the response object to return.
"""
- status, headers, app_iter = self.call_application(application)
+ if catch_exc_info:
+ status, headers, app_iter, exc_info = self.call_application(
+ application, catch_exc_info=True)
+ del exc_info
+ else:
+ status, headers, app_iter = self.call_application(
+ application, catch_exc_info=False)
return self.ResponseClass(
- status=status,
- headerlist=list(headers),
- app_iter=app_iter
- )
+ status=status, headerlist=list(headers), app_iter=app_iter)
@classmethod
def blank(cls, path, environ=None, base_url=None,