Lines Matching defs:tstate

27 _PyErr_FormatV(PyThreadState *tstate, PyObject *exception,
32 _PyErr_Restore(PyThreadState *tstate, PyObject *type, PyObject *value,
46 oldtype = tstate->curexc_type;
47 oldvalue = tstate->curexc_value;
48 oldtraceback = tstate->curexc_traceback;
50 tstate->curexc_type = type;
51 tstate->curexc_value = value;
52 tstate->curexc_traceback = traceback;
62 PyThreadState *tstate = _PyThreadState_GET();
63 _PyErr_Restore(tstate, type, value, traceback);
68 _PyErr_GetTopmostException(PyThreadState *tstate)
70 _PyErr_StackItem *exc_info = tstate->exc_info;
108 _PyErr_SetObject(PyThreadState *tstate, PyObject *exception, PyObject *value)
115 _PyErr_Format(tstate, PyExc_SystemError,
123 exc_value = _PyErr_GetTopmostException(tstate)->exc_value;
133 _PyErr_Clear(tstate);
182 _PyErr_Restore(tstate, exception, value, tb);
188 PyThreadState *tstate = _PyThreadState_GET();
189 _PyErr_SetObject(tstate, exception, value);
198 PyThreadState *tstate = _PyThreadState_GET();
204 _PyErr_SetObject(tstate, PyExc_KeyError, tup);
209 _PyErr_SetNone(PyThreadState *tstate, PyObject *exception)
211 _PyErr_SetObject(tstate, exception, (PyObject *)NULL);
218 PyThreadState *tstate = _PyThreadState_GET();
219 _PyErr_SetNone(tstate, exception);
224 _PyErr_SetString(PyThreadState *tstate, PyObject *exception,
228 _PyErr_SetObject(tstate, exception, value);
235 PyThreadState *tstate = _PyThreadState_GET();
236 _PyErr_SetString(tstate, exception, string);
246 PyThreadState *tstate = _PyThreadState_GET();
247 return _PyErr_Occurred(tstate);
284 _PyErr_ExceptionMatches(PyThreadState *tstate, PyObject *exc)
286 return PyErr_GivenExceptionMatches(_PyErr_Occurred(tstate), exc);
293 PyThreadState *tstate = _PyThreadState_GET();
294 return _PyErr_ExceptionMatches(tstate, exc);
309 _PyErr_NormalizeException(PyThreadState *tstate, PyObject **exc,
313 tstate->recursion_headroom++;
320 tstate->recursion_headroom--;
372 tstate->recursion_headroom--;
380 _PyErr_SetString(tstate, PyExc_RecursionError,
389 _PyErr_Fetch(tstate, exc, val, tb);
418 PyThreadState *tstate = _PyThreadState_GET();
419 _PyErr_NormalizeException(tstate, exc, val, tb);
424 _PyErr_Fetch(PyThreadState *tstate, PyObject **p_type, PyObject **p_value,
427 *p_type = tstate->curexc_type;
428 *p_value = tstate->curexc_value;
429 *p_traceback = tstate->curexc_traceback;
431 tstate->curexc_type = NULL;
432 tstate->curexc_value = NULL;
433 tstate->curexc_traceback = NULL;
440 PyThreadState *tstate = _PyThreadState_GET();
441 _PyErr_Fetch(tstate, p_type, p_value, p_traceback);
446 _PyErr_Clear(PyThreadState *tstate)
448 _PyErr_Restore(tstate, NULL, NULL, NULL);
455 PyThreadState *tstate = _PyThreadState_GET();
456 _PyErr_Clear(tstate);
488 _PyErr_GetExcInfo(PyThreadState *tstate,
491 _PyErr_StackItem *exc_info = _PyErr_GetTopmostException(tstate);
503 _PyErr_GetHandledException(PyThreadState *tstate)
505 _PyErr_StackItem *exc_info = _PyErr_GetTopmostException(tstate);
516 PyThreadState *tstate = _PyThreadState_GET();
517 return _PyErr_GetHandledException(tstate);
521 _PyErr_SetHandledException(PyThreadState *tstate, PyObject *exc)
523 Py_XSETREF(tstate->exc_info->exc_value, Py_XNewRef(exc));
529 PyThreadState *tstate = _PyThreadState_GET();
530 _PyErr_SetHandledException(tstate, exc);
536 PyThreadState *tstate = _PyThreadState_GET();
537 _PyErr_GetExcInfo(tstate, p_type, p_value, p_traceback);
582 PyThreadState *tstate = _PyThreadState_GET();
585 _PyErr_Format(tstate, PyExc_SystemError,
592 if (_PyErr_Occurred(tstate)) {
594 _PyErr_Fetch(tstate, &typ2, &val2, &tb2);
595 _PyErr_NormalizeException(tstate, &typ, &val, &tb);
601 _PyErr_NormalizeException(tstate, &typ2, &val2, &tb2);
603 _PyErr_Restore(tstate, typ2, val2, tb2);
606 _PyErr_Restore(tstate, typ, val, tb);
621 PyThreadState *tstate = _PyThreadState_GET();
622 assert(_PyErr_Occurred(tstate));
627 exc_info = tstate->exc_info;
640 saved_exc_info = tstate->exc_info;
641 tstate->exc_info = exc_info;
645 _PyErr_Fetch(tstate, &typ, &val, &tb);
648 _PyErr_SetObject(tstate, typ, val);
654 tstate->exc_info = saved_exc_info;
659 _PyErr_FormatVFromCause(PyThreadState *tstate, PyObject *exception,
664 assert(_PyErr_Occurred(tstate));
665 _PyErr_Fetch(tstate, &exc, &val, &tb);
666 _PyErr_NormalizeException(tstate, &exc, &val, &tb);
672 assert(!_PyErr_Occurred(tstate));
674 _PyErr_FormatV(tstate, exception, format, vargs);
676 _PyErr_Fetch(tstate, &exc, &val2, &tb);
677 _PyErr_NormalizeException(tstate, &exc, &val2, &tb);
681 _PyErr_Restore(tstate, exc, val2, tb);
687 _PyErr_FormatFromCauseTstate(PyThreadState *tstate, PyObject *exception,
696 _PyErr_FormatVFromCause(tstate, exception, format, vargs);
704 PyThreadState *tstate = _PyThreadState_GET();
711 _PyErr_FormatVFromCause(tstate, exception, format, vargs);
721 PyThreadState *tstate = _PyThreadState_GET();
722 _PyErr_SetString(tstate, PyExc_TypeError,
728 _PyErr_NoMemory(PyThreadState *tstate)
736 _PyErr_SetNone(tstate, PyExc_MemoryError);
743 PyThreadState *tstate = _PyThreadState_GET();
744 return _PyErr_NoMemory(tstate);
756 PyThreadState *tstate = _PyThreadState_GET();
842 _PyErr_SetObject(tstate, (PyObject *) Py_TYPE(v), v);
884 PyThreadState *tstate = _PyThreadState_GET();
939 _PyErr_SetObject(tstate, (PyObject *) Py_TYPE(v), v);
990 PyThreadState *tstate = _PyThreadState_GET();
999 _PyErr_SetString(tstate, PyExc_TypeError,
1005 _PyErr_SetString(tstate, PyExc_TypeError,
1030 _PyErr_SetObject(tstate, (PyObject *)Py_TYPE(error), error);
1048 PyThreadState *tstate = _PyThreadState_GET();
1049 _PyErr_Format(tstate, PyExc_SystemError,
1061 PyThreadState *tstate = _PyThreadState_GET();
1062 _PyErr_SetString(tstate, PyExc_SystemError,
1069 _PyErr_FormatV(PyThreadState *tstate, PyObject *exception,
1076 _PyErr_Clear(tstate);
1080 _PyErr_SetObject(tstate, exception, string);
1089 PyThreadState *tstate = _PyThreadState_GET();
1090 return _PyErr_FormatV(tstate, exception, format, vargs);
1095 _PyErr_Format(PyThreadState *tstate, PyObject *exception,
1104 _PyErr_FormatV(tstate, exception, format, vargs);
1113 PyThreadState *tstate = _PyThreadState_GET();
1120 _PyErr_FormatV(tstate, exception, format, vargs);
1129 PyThreadState *tstate = _PyThreadState_GET();
1137 _PyErr_SetString(tstate, PyExc_SystemError,
1269 make_unraisable_hook_args(PyThreadState *tstate, PyObject *exc_type,
1296 if (_PyErr_Occurred(tstate)) {
1311 write_unraisable_exc_file(PyThreadState *tstate, PyObject *exc_type,
1331 _PyErr_Clear(tstate);
1352 _PyErr_Clear(tstate);
1365 _PyErr_Clear(tstate);
1390 _PyErr_Clear(tstate);
1408 _PyErr_Clear(tstate);
1431 write_unraisable_exc(PyThreadState *tstate, PyObject *exc_type,
1435 PyObject *file = _PySys_GetAttr(tstate, &_Py_ID(stderr));
1443 int res = write_unraisable_exc_file(tstate, exc_type, exc_value, exc_tb,
1454 PyThreadState *tstate = _PyThreadState_GET();
1457 _PyErr_SetString(tstate, PyExc_TypeError,
1470 if (write_unraisable_exc(tstate, exc_type, exc_value, exc_tb, err_msg, obj) < 0) {
1491 PyThreadState *tstate = _PyThreadState_GET();
1492 _Py_EnsureTstateNotNULL(tstate);
1496 _PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb);
1506 PyFrameObject *frame = PyThreadState_GetFrame(tstate);
1510 _PyErr_Clear(tstate);
1516 _PyErr_NormalizeException(tstate, &exc_type, &exc_value, &exc_tb);
1520 _PyErr_Clear(tstate);
1532 tstate, exc_type, exc_value, exc_tb, err_msg, obj);
1539 PyObject *hook = _PySys_GetAttr(tstate, &_Py_ID(unraisablehook));
1545 if (_PySys_Audit(tstate, "sys.unraisablehook", "OO", hook, hook_args) < 0) {
1575 _PyErr_Fetch(tstate, &exc_type, &exc_value, &exc_tb);
1579 (void)write_unraisable_exc(tstate, exc_type, exc_value, exc_tb,
1587 _PyErr_Clear(tstate); /* Just in case */
1614 PyThreadState *tstate = _PyThreadState_GET();
1617 _PyErr_Fetch(tstate, &exc, &v, &tb);
1618 _PyErr_NormalizeException(tstate, &exc, &v, &tb);
1623 _PyErr_Clear(tstate);
1626 _PyErr_Clear(tstate);
1634 _PyErr_Clear(tstate);
1638 _PyErr_Clear(tstate);
1646 _PyErr_Clear(tstate);
1650 _PyErr_Clear(tstate);
1658 _PyErr_Clear(tstate);
1662 _PyErr_Clear(tstate);
1669 _PyErr_Clear(tstate);
1675 _PyErr_Clear(tstate);
1680 _PyErr_Clear(tstate);
1685 _PyErr_Clear(tstate);
1694 _PyErr_Clear(tstate);
1699 _PyErr_Clear(tstate);
1704 _PyErr_Clear(tstate);
1711 _PyErr_Clear(tstate);
1715 _PyErr_Restore(tstate, exc, v, tb);
1732 PyThreadState *tstate = _PyThreadState_GET();
1737 _PyErr_Clear(tstate);
1754 err_programtext(PyThreadState *tstate, FILE *fp, int lineno, const char* encoding)
1788 _PyErr_Clear(tstate);
1818 PyThreadState *tstate = _PyThreadState_GET();
1821 _PyErr_Clear(tstate);
1824 return err_programtext(tstate, fp, lineno, encoding);