summaryrefslogtreecommitdiff
path: root/OpenSSL/_util.py
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSSL/_util.py')
-rw-r--r--OpenSSL/_util.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/OpenSSL/_util.py b/OpenSSL/_util.py
index 7c606b9..baeecc6 100644
--- a/OpenSSL/_util.py
+++ b/OpenSSL/_util.py
@@ -6,15 +6,18 @@ ffi = binding.ffi
lib = binding.lib
def exception_from_error_queue(exceptionType):
+ def text(charp):
+ return native(ffi.string(charp))
+
errors = []
while True:
error = lib.ERR_get_error()
if error == 0:
break
errors.append((
- ffi.string(lib.ERR_lib_error_string(error)),
- ffi.string(lib.ERR_func_error_string(error)),
- ffi.string(lib.ERR_reason_error_string(error))))
+ text(lib.ERR_lib_error_string(error)),
+ text(lib.ERR_func_error_string(error)),
+ text(lib.ERR_reason_error_string(error))))
raise exceptionType(errors)