def _consume_errors(lib): errors = [] while True: code = lib.ERR_get_error() if code == 0: break err_lib = lib.ERR_GET_LIB(code) err_func = lib.ERR_GET_FUNC(code) err_reason = lib.ERR_GET_REASON(code) errors.append(_OpenSSLError(code, err_lib, err_func, err_reason)) return errors
def _consume_errors(lib) -> typing.List[_OpenSSLError]: errors = [] while True: code: int = lib.ERR_get_error() if code == 0: break err_lib: int = lib.ERR_GET_LIB(code) err_reason: int = lib.ERR_GET_REASON(code) errors.append(_OpenSSLError(code, err_lib, err_reason)) return errors