summaryrefslogtreecommitdiff
path: root/paste/errordocument.py
diff options
context:
space:
mode:
Diffstat (limited to 'paste/errordocument.py')
-rw-r--r--paste/errordocument.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/paste/errordocument.py b/paste/errordocument.py
index b041203..3a7c670 100644
--- a/paste/errordocument.py
+++ b/paste/errordocument.py
@@ -175,6 +175,10 @@ class StatusBasedForward:
app_iter = self.application(environ, change_response)
if url:
+ if hasattr(app_iter, 'close'):
+ list(app_iter)
+ app_iter.close()
+
if self.debug:
environ['wsgi.errors'].write(
'=> paste.errordocuments: -> %r\n'%url[0][0]