From 64e339d96f964da3df60ea67ac0f6fdc9483d664 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 25 Dec 2009 04:35:37 +0000 Subject: Normalize code blocks. --- docs/narr/webob.rst | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'docs') diff --git a/docs/narr/webob.rst b/docs/narr/webob.rst index 30e5ba1d6..2886190f5 100644 --- a/docs/narr/webob.rst +++ b/docs/narr/webob.rst @@ -278,12 +278,14 @@ Python 2.5. To get an exception object use ``response.exception``. You can use this like: .. code-block:: python - - try: - ... stuff ... - raise HTTPNotFound('No such resource').exception - except HTTPException, e: - return e(environ, start_response) + :linenos: + + def aview(request): + try: + # ... stuff ... + raise HTTPNotFound('No such resource').exception + except HTTPException, e: + return e(environ, start_response) The exceptions are still WSGI applications, but you cannot set attributes like ``content_type``, ``charset``, etc. on these exception -- cgit v1.2.3