summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-12-25 04:35:37 +0000
committerChris McDonough <chrism@agendaless.com>2009-12-25 04:35:37 +0000
commit64e339d96f964da3df60ea67ac0f6fdc9483d664 (patch)
tree4e9b17b2deadb90b6c58d9f8e48327d89d886472
parent82726d3b4308d4ccc0cfc4632e0c32c0061428e7 (diff)
downloadpyramid-64e339d96f964da3df60ea67ac0f6fdc9483d664.tar.gz
pyramid-64e339d96f964da3df60ea67ac0f6fdc9483d664.tar.bz2
pyramid-64e339d96f964da3df60ea67ac0f6fdc9483d664.zip
Normalize code blocks.
-rw-r--r--docs/narr/webob.rst14
1 files changed, 8 insertions, 6 deletions
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