summaryrefslogtreecommitdiff
path: root/django/core/handlers/modpython.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-09-22 12:32:00 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2006-09-22 12:32:00 +0000
commitc3d7aad6d0911bb84120d7c8d41923c895784b21 (patch)
treec448c631a17d311170fbd450bca90e2825064c4e /django/core/handlers/modpython.py
parentdc39762fde7c9a20f3bcf2025ca2cb46e5c73433 (diff)
Fixed #2560 -- Add close() support to HttpResponse iterators. Thanks, Ivan
Sagalaev. git-svn-id: http://code.djangoproject.com/svn/django/trunk@3791 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/handlers/modpython.py')
-rw-r--r--django/core/handlers/modpython.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/django/core/handlers/modpython.py b/django/core/handlers/modpython.py
index 07c98e3b59..db3c33147b 100644
--- a/django/core/handlers/modpython.py
+++ b/django/core/handlers/modpython.py
@@ -155,8 +155,11 @@ def populate_apache_request(http_response, mod_python_req):
for c in http_response.cookies.values():
mod_python_req.headers_out.add('Set-Cookie', c.output(header=''))
mod_python_req.status = http_response.status_code
- for chunk in http_response.iterator:
- mod_python_req.write(chunk)
+ try:
+ for chunk in http_response:
+ mod_python_req.write(chunk)
+ finally:
+ http_response.close()
def handler(req):
# mod_python hooks into this function.