From: Brian Curtin Date: Sun, 31 Oct 2010 00:34:23 +0000 (+0000) Subject: Fix ResourceWarning for an unclosed socket. X-Git-Tag: v3.2a4~239 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=61d0d60e13d4abf0abe85462c648586d53959711;p=thirdparty%2FPython%2Fcpython.git Fix ResourceWarning for an unclosed socket. test_return_header_keep_alive - Added a cleanup call for the socket. --- diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index ddb50dc23f20..daf37b2788ce 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -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', '/')