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