def request(self, req):
        if self.cached:
            # Try once to use the cached connection; if it fails to send the
            # request then discard and try again.
            try:
                return self.requestOnce(self.cached, req)
            except http_error.RequestError, err:
                err.wrapped.clear()
                self.cached.close()
                self.cached = None
        # If a problem occurs before or during the sending of the request, then
        # throw a wrapper exception so that the caller knows it is safe to
        # retry. Once the request is sent retries must be done more carefully
        # as side effects may have occurred.
        try:
            conn = self.openConnection()
        except (__HOLE__, SystemExit):
            raise
        except:
            wrapped = util.SavedException()
            raise http_error.RequestError(wrapped)
        # Note that requestOnce may also throw RequestError, see above.
        ret = self.requestOnce(conn, req)
        if not ret.will_close:
            self.cached = conn
        return ret
dataset/ETHPy150Open sassoftware/conary/conary/lib/http/connection.py/Connection.request