

def getresponse(self):
    'Get the response from the server.\n\n        If the HTTPConnection is in the correct state, returns an\n        instance of HTTPResponse or of whatever object is returned by\n        class the response_class variable.\n\n        If a request has not been sent or if a previous response has\n        not be handled, ResponseNotReady is raised.  If the HTTP\n        response indicates that the connection should be closed, then\n        it will be closed before the response is returned.  When the\n        connection is closed, the underlying socket is closed.\n        '
    if (self.__response and self.__response.isclosed()):
        self.__response = None
    if ((self.__state != _CS_REQ_SENT) or self.__response):
        raise ResponseNotReady(self.__state)
    if (self.debuglevel > 0):
        response = self.response_class(self.sock, self.debuglevel, method=self._method)
    else:
        response = self.response_class(self.sock, method=self._method)
    response.begin()
    assert (response.will_close != _UNKNOWN)
    self.__state = _CS_IDLE
    if response.will_close:
        self.close()
    else:
        self.__response = response
    return response

dataset/ETHPy150Open OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/future/backports/http/client.py HTTPConnection.getresponse/original