summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.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/sysmodule.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/sysmodule.c')
-rw-r--r--Python/sysmodule.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 3e2091e..13fae79 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -785,12 +785,7 @@ sys_exc_info_impl(PyObject *module)
/*[clinic end generated code: output=3afd0940cf3a4d30 input=b5c5bf077788a3e5]*/
{
_PyErr_StackItem *err_info = _PyErr_GetTopmostException(_PyThreadState_GET());
- return Py_BuildValue(
- "(OOO)",
- 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);
+ return _PyErr_StackItemToExcInfoTuple(err_info);
}