def exception_from_error_queue(exception_type):
 errors = []
 while True:
  error = lib.ERR_get_error()
  if (error == 0):
   break
  errors.append((text(lib.ERR_lib_error_string(error)), text(lib.ERR_func_error_string(error)), text(lib.ERR_reason_error_string(error))))
 raise exception_type(errors)

def exception_from_error_queue ( exception_type ) : errors = [ ] while True : error = lib . ERR_get_error ( ) if ( error == 0 ) : break errors . append ( ( text ( lib . ERR_lib_error_string ( error ) ) , text ( lib . ERR_func_error_string ( error ) ) , text ( lib . ERR_reason_error_string ( error ) ) ) ) raise exception_type ( errors )
convert an openssl library failure into a python exception .