Skip to content
Browse files

Avoided premature termination of HttpResponseBase.close().

  • Loading branch information...
1 parent d982193 commit b5f63cbaa978539b6caa040dc4cee1ef80676466 @aaugustin committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 django/http/response.py
View
5 django/http/response.py
@@ -226,7 +226,10 @@ def __next__(self):
# See http://blog.dscpl.com.au/2012/10/obligations-for-calling-close-on.html
def close(self):
for closable in self._closable_objects:
- closable.close()
+ try:
+ closable.close()
+ except Exception:
+ pass
def write(self, content):
raise Exception("This %s instance is not writable" % self.__class__.__name__)

0 comments on commit b5f63cb

Please sign in to comment.
Something went wrong with that request. Please try again.