]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Remove __del__ method from HTTPResponse. Closing cStringIO objects isn't
authorBen Darnell <ben@bendarnell.com>
Wed, 1 Sep 2010 22:16:57 +0000 (15:16 -0700)
committerBen Darnell <ben@bendarnell.com>
Wed, 1 Sep 2010 22:16:57 +0000 (15:16 -0700)
really necessary, and the presence of a __del__ method prevents python's
GC from breaking cyclical references (which happen on errors as HTTPError
and HTTPResponse refer to each other).

Closes #125.

tornado/httpclient.py

index cfa0b4c60250739287f175ca43adad36fb99ffa2..049a1cd112dbe815a107d20f9ed1e1c6c40722b0 100644 (file)
@@ -469,10 +469,6 @@ class HTTPResponse(object):
         args = ",".join("%s=%r" % i for i in self.__dict__.iteritems())
         return "%s(%s)" % (self.__class__.__name__, args)
 
-    def __del__(self):
-        if self.buffer is not None:
-            self.buffer.close()
-
 
 class HTTPError(Exception):
     """Exception thrown for an unsuccessful HTTP request.