summaryrefslogtreecommitdiffstats
path: root/Modules/_ssl
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-03-16 16:41:10 (GMT)
committerGitHub <noreply@github.com>2023-03-16 16:41:10 (GMT)
commite108af6eca9904d177d769281907d12ac6894dfc (patch)
tree6a3ce53e72ad386f6e43c2607e334ea824572f45 /Modules/_ssl
parent61d6c110d6019a7ba79c76cc50aeaa85a1b37c08 (diff)
downloadcpython-e108af6eca9904d177d769281907d12ac6894dfc.zip
cpython-e108af6eca9904d177d769281907d12ac6894dfc.tar.gz
cpython-e108af6eca9904d177d769281907d12ac6894dfc.tar.bz2
gh-102192: remove redundant exception fields from ssl module socket (#102466)
Diffstat (limited to 'Modules/_ssl')
-rw-r--r--Modules/_ssl/debughelpers.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Modules/_ssl/debughelpers.c b/Modules/_ssl/debughelpers.c
index 08f3457..217f224 100644
--- a/Modules/_ssl/debughelpers.c
+++ b/Modules/_ssl/debughelpers.c
@@ -74,7 +74,7 @@ _PySSL_msg_callback(int write_p, int version, int content_type,
buf, len
);
if (res == NULL) {
- PyErr_Fetch(&ssl_obj->exc_type, &ssl_obj->exc_value, &ssl_obj->exc_tb);
+ ssl_obj->exc = PyErr_GetRaisedException();
} else {
Py_DECREF(res);
}
@@ -138,8 +138,7 @@ _PySSL_keylog_callback(const SSL *ssl, const char *line)
lock = PyThread_allocate_lock();
if (lock == NULL) {
PyErr_SetString(PyExc_MemoryError, "Unable to allocate lock");
- PyErr_Fetch(&ssl_obj->exc_type, &ssl_obj->exc_value,
- &ssl_obj->exc_tb);
+ ssl_obj->exc = PyErr_GetRaisedException();
return;
}
}
@@ -156,7 +155,7 @@ _PySSL_keylog_callback(const SSL *ssl, const char *line)
errno = e;
PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError,
ssl_obj->ctx->keylog_filename);
- PyErr_Fetch(&ssl_obj->exc_type, &ssl_obj->exc_value, &ssl_obj->exc_tb);
+ ssl_obj->exc = PyErr_GetRaisedException();
}
PyGILState_Release(threadstate);
}