def _raise_errors(self, possible_error): if possible_error is RAISE_EAGAIN: raise socket.error(errno.EAGAIN, "try again later") elif possible_error is RAISE_WANT_READ: raise ssl.SSLWantReadError("Want read") elif possible_error is RAISE_WANT_WRITE: raise ssl.SSLWantWriteError("Want write")
def recv_data(self, control_frame=False): if self.returndata: return ABNF.OPCODE_TEXT, self.returndata.pop(0) else: raise ssl.SSLWantReadError()