diff --git a/pyghmi/util/webclient.py b/pyghmi/util/webclient.py index 6d7f2201..706ec60e 100644 --- a/pyghmi/util/webclient.py +++ b/pyghmi/util/webclient.py @@ -151,6 +151,11 @@ class SecureHTTPConnection(httplib.HTTPConnection, object): if '[' not in host and '%' in host and 'Host'not in self.stdheaders: self.stdheaders['Host'] = '[' + host[:host.find('%')] + ']' + def __del__(self): + if self.sock: + self.sock.close() + self.sock = None + def dupe(self): return SecureHTTPConnection(self.thehost, self.theport, clone=self, timeout=self.mytimeout)