def connect(self): httplib.HTTPSConnection.connect(self) timeout = getattr(self, "_timeout", 0) if timeout: self.sock.settimeout(timeout)