From 71012a4be3830b1040815243ebb7c0d48dbd8e57 Mon Sep 17 00:00:00 2001 From: Jason Pellerin Date: Wed, 29 Nov 2006 20:02:43 +0000 Subject: [multi-db] Merge trunk to [3812]. Some tests still failing. git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@4139 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/handlers/modpython.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'django/core/handlers/modpython.py') 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. -- cgit v1.3