]> granicus.if.org Git - python/commitdiff
Merged revisions 86006 via svnmerge from
authorBrian Curtin <brian.curtin@gmail.com>
Sun, 31 Oct 2010 00:36:01 +0000 (00:36 +0000)
committerBrian Curtin <brian.curtin@gmail.com>
Sun, 31 Oct 2010 00:36:01 +0000 (00:36 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86006 | brian.curtin | 2010-10-30 19:34:23 -0500 (Sat, 30 Oct 2010) | 3 lines

  Fix ResourceWarning for an unclosed socket.
  test_return_header_keep_alive - Added a cleanup call for the socket.
........

Lib/test/test_httpservers.py

index a00c5f21716461f58d736ba1986af450101cc0ef..7dee6f5e8ac5b43cb5abd4c508efccd17df5e591 100644 (file)
@@ -256,6 +256,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', '/')