summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2021-11-25 09:41:28 (GMT)
committerGitHub <noreply@github.com>2021-11-25 09:41:28 (GMT)
commitc456dfafe9f9f6614fbcf2213a93707f0e101f4e (patch)
tree4c83ea059d9dc4eefe8d7e0a414e824c786c5128 /Python/pystate.c
parent24c10d2943c482c4d3ecc71d45df2d8c10fa5bb1 (diff)
downloadcpython-c456dfafe9f9f6614fbcf2213a93707f0e101f4e.zip
cpython-c456dfafe9f9f6614fbcf2213a93707f0e101f4e.tar.gz
cpython-c456dfafe9f9f6614fbcf2213a93707f0e101f4e.tar.bz2
bpo-45711: use exc_value instead of exc_type to determine if exc_info is valid. Add more assertions. (GH-29627)
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 56db095d..ba14c9d 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -1341,11 +1341,7 @@ _PyThread_CurrentExceptions(void)
if (id == NULL) {
goto fail;
}
- PyObject *exc_info = PyTuple_Pack(
- 3,
- err_info->exc_type != NULL ? err_info->exc_type : Py_None,
- err_info->exc_value != NULL ? err_info->exc_value : Py_None,
- err_info->exc_traceback != NULL ? err_info->exc_traceback : Py_None);
+ PyObject *exc_info = _PyErr_StackItemToExcInfoTuple(err_info);
if (exc_info == NULL) {
Py_DECREF(id);
goto fail;