mirror of
https://github.com/python/cpython.git
synced 2025-09-04 07:51:13 +00:00
Move exc state to generator. Fixes bpo-25612 (#1773)
Move exception state information from frame objects to coroutine (generator/thread) object where it belongs.
This commit is contained in:
parent
91dc64ba3f
commit
ae3087c638
13 changed files with 188 additions and 164 deletions
|
@ -311,14 +311,13 @@ PyDoc_STRVAR(excepthook_doc,
|
|||
static PyObject *
|
||||
sys_exc_info(PyObject *self, PyObject *noargs)
|
||||
{
|
||||
PyThreadState *tstate;
|
||||
tstate = PyThreadState_GET();
|
||||
_PyErr_StackItem *err_info = _PyErr_GetTopmostException(PyThreadState_GET());
|
||||
return Py_BuildValue(
|
||||
"(OOO)",
|
||||
tstate->exc_type != NULL ? tstate->exc_type : Py_None,
|
||||
tstate->exc_value != NULL ? tstate->exc_value : Py_None,
|
||||
tstate->exc_traceback != NULL ?
|
||||
tstate->exc_traceback : Py_None);
|
||||
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);
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(exc_info_doc,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue