summaryrefslogtreecommitdiff
path: root/paste
diff options
context:
space:
mode:
authorianb <devnull@localhost>2005-07-11 21:29:27 +0000
committerianb <devnull@localhost>2005-07-11 21:29:27 +0000
commit8d0c22867b505ab42d5113a16e9c973c606d3a03 (patch)
tree5c7641dea71ec15db9bcc0c8e6fd997a15622fe7 /paste
parent1ac48b787dad6629a36e68532e2f758c20e30e25 (diff)
downloadpaste-8d0c22867b505ab42d5113a16e9c973c606d3a03.tar.gz
Create fast path for applications that return lists or tuples with catch_errors
Diffstat (limited to 'paste')
-rw-r--r--paste/wsgilib.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/paste/wsgilib.py b/paste/wsgilib.py
index e026b61..7b0091d 100644
--- a/paste/wsgilib.py
+++ b/paste/wsgilib.py
@@ -88,7 +88,12 @@ def catch_errors(application, environ, start_response, error_callback,
except:
error_callback(sys.exc_info())
raise
- return _wrap_app_iter(app_iter, error_callback, ok_callback)
+ if type(app_iter) in (list, tuple):
+ # These won't produce exceptions
+ ok_callback()
+ return app_iter
+ else:
+ return _wrap_app_iter(app_iter, error_callback, ok_callback)
class _wrap_app_iter(object):