You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.6 KiB

  1. #ifndef Py_INTERNAL_PYERRORS_H
  2. #define Py_INTERNAL_PYERRORS_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #ifndef Py_BUILD_CORE
  7. # error "this header requires Py_BUILD_CORE define"
  8. #endif
  9. static inline PyObject* _PyErr_Occurred(PyThreadState *tstate)
  10. {
  11. assert(tstate != NULL);
  12. return tstate->curexc_type;
  13. }
  14. PyAPI_FUNC(void) _PyErr_Fetch(
  15. PyThreadState *tstate,
  16. PyObject **type,
  17. PyObject **value,
  18. PyObject **traceback);
  19. PyAPI_FUNC(int) _PyErr_ExceptionMatches(
  20. PyThreadState *tstate,
  21. PyObject *exc);
  22. PyAPI_FUNC(void) _PyErr_Restore(
  23. PyThreadState *tstate,
  24. PyObject *type,
  25. PyObject *value,
  26. PyObject *traceback);
  27. PyAPI_FUNC(void) _PyErr_SetObject(
  28. PyThreadState *tstate,
  29. PyObject *type,
  30. PyObject *value);
  31. PyAPI_FUNC(void) _PyErr_Clear(PyThreadState *tstate);
  32. PyAPI_FUNC(void) _PyErr_SetNone(PyThreadState *tstate, PyObject *exception);
  33. PyAPI_FUNC(PyObject *) _PyErr_NoMemory(PyThreadState *tstate);
  34. PyAPI_FUNC(void) _PyErr_SetString(
  35. PyThreadState *tstate,
  36. PyObject *exception,
  37. const char *string);
  38. PyAPI_FUNC(PyObject *) _PyErr_Format(
  39. PyThreadState *tstate,
  40. PyObject *exception,
  41. const char *format,
  42. ...);
  43. PyAPI_FUNC(void) _PyErr_NormalizeException(
  44. PyThreadState *tstate,
  45. PyObject **exc,
  46. PyObject **val,
  47. PyObject **tb);
  48. PyAPI_FUNC(PyObject *) _PyErr_FormatFromCauseTstate(
  49. PyThreadState *tstate,
  50. PyObject *exception,
  51. const char *format,
  52. ...);
  53. PyAPI_FUNC(int) _PyErr_CheckSignalsTstate(PyThreadState *tstate);
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #endif /* !Py_INTERNAL_PYERRORS_H */