aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2021-09-30 14:40:20 +0300
committerMatti Picus <matti.picus@gmail.com>2021-09-30 14:40:20 +0300
commitb7bb24a9c5e65b480c9fa5f29d1fb8ab4ce29caa (patch)
tree70c363722c0a9331e84b877a72dc4c40e9eb7ea4
parentmerge hpy-0.0.3 into py3.7 (diff)
downloadpypy-b7bb24a9c5e65b480c9fa5f29d1fb8ab4ce29caa.tar.gz
pypy-b7bb24a9c5e65b480c9fa5f29d1fb8ab4ce29caa.tar.bz2
pypy-b7bb24a9c5e65b480c9fa5f29d1fb8ab4ce29caa.zip
backport some error message fixes from py3.8
-rw-r--r--lib_pypy/_cffi_ssl/_stdssl/error.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib_pypy/_cffi_ssl/_stdssl/error.py b/lib_pypy/_cffi_ssl/_stdssl/error.py
index 31811e2ae0..be4ce40ebd 100644
--- a/lib_pypy/_cffi_ssl/_stdssl/error.py
+++ b/lib_pypy/_cffi_ssl/_stdssl/error.py
@@ -124,7 +124,7 @@ def pyssl_error(obj, ret):
if err.ws:
return OSError(err.ws)
if err.c:
- ffi.errno = err.c
+ ffi.errno = err.c
errno = ffi.errno
return OSError(errno, os.strerror(errno))
else:
@@ -179,11 +179,11 @@ def fill_sslerror(obj, errtype, ssl_errno, errstr, errcode):
if not verify_str:
verify_str = ffi.string(lib.X509_verify_cert_error_string(verify_code)).decode()
if verify_str and reason_str and lib_str:
- msg = f"{verify_str}"
+ msg = f'[{lib_str}: {reason_str}] {errstr}: {verify_str}'
elif reason_str and lib_str:
- msg = "[%s: %s] %s" % (lib_str, reason_str, errstr)
+ msg = f"[{lib_str}: {reason_str}] {errstr}"
elif lib_str:
- msg = "[%s] %s" % (lib_str, errstr)
+ msg = f"[{lib_str}] {errstr}"
err_value = errtype(ssl_errno, msg)
err_value.reason = reason_str if reason_str else None