

def read(self, amt=None):
    if (self.fp is None):
        return bytes(b'')
    if (self._method == 'HEAD'):
        self._close_conn()
        return bytes(b'')
    if (amt is not None):
        return bytes(super(HTTPResponse, self).read(amt))
    else:
        if self.chunked:
            return self._readall_chunked()
        if (self.length is None):
            s = self.fp.read()
        else:
            try:
                s = self._safe_read(self.length)
            except IncompleteRead:
                self._close_conn()
                raise
            self.length = 0
        self._close_conn()
        return bytes(s)

dataset/ETHPy150Open OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/future/backports/http/client.py HTTPResponse.read/original