]> granicus.if.org Git - python/commitdiff
Fix ResourceWarning for an unclosed socket.
authorBrian Curtin <brian.curtin@gmail.com>
Sun, 31 Oct 2010 00:34:23 +0000 (00:34 +0000)
committerBrian Curtin <brian.curtin@gmail.com>
Sun, 31 Oct 2010 00:34:23 +0000 (00:34 +0000)
test_return_header_keep_alive - Added a cleanup call for the socket.

Lib/test/test_httpservers.py

index ddb50dc23f206f5f5472700d40e12273e9803be8..daf37b2788ce5cadfa1f8acc912dcc64074510a0 100644 (file)
@@ -182,6 +182,7 @@ class BaseHTTPServerTestCase(BaseTestCase):
         res = self.con.getresponse()
         self.assertEqual(res.getheader('Connection'), 'keep-alive')
         self.con.request('TEST', '/')
+        self.addCleanup(self.con.close)
 
     def test_internal_key_error(self):
         self.con.request('KEYERROR', '/')