1use crate::PyObject;
2#[cfg(not(PyPy))]
3use crate::Py_ssize_t;
4
5#[repr(C)]
6#[derive(Debug)]
7pub struct PyBaseExceptionObject {
8 pub ob_base: PyObject,
9 #[cfg(not(PyPy))]
10 pub dict: *mut PyObject,
11 #[cfg(not(PyPy))]
12 pub args: *mut PyObject,
13 #[cfg(all(Py_3_11, not(PyPy)))]
14 pub notes: *mut PyObject,
15 #[cfg(not(PyPy))]
16 pub traceback: *mut PyObject,
17 #[cfg(not(PyPy))]
18 pub context: *mut PyObject,
19 #[cfg(not(PyPy))]
20 pub cause: *mut PyObject,
21 #[cfg(not(PyPy))]
22 pub suppress_context: char,
23}
24
25#[cfg(not(PyPy))]
26#[repr(C)]
27#[derive(Debug)]
28pub struct PySyntaxErrorObject {
29 pub ob_base: PyObject,
30 pub dict: *mut PyObject,
31 pub args: *mut PyObject,
32 #[cfg(Py_3_11)]
33 pub notes: *mut PyObject,
34 pub traceback: *mut PyObject,
35 pub context: *mut PyObject,
36 pub cause: *mut PyObject,
37 pub suppress_context: char,
38
39 pub msg: *mut PyObject,
40 pub filename: *mut PyObject,
41 pub lineno: *mut PyObject,
42 pub offset: *mut PyObject,
43 #[cfg(Py_3_10)]
44 pub end_lineno: *mut PyObject,
45 #[cfg(Py_3_10)]
46 pub end_offset: *mut PyObject,
47 pub text: *mut PyObject,
48 pub print_file_and_line: *mut PyObject,
49}
50
51#[cfg(not(PyPy))]
52#[repr(C)]
53#[derive(Debug)]
54pub struct PyImportErrorObject {
55 pub ob_base: PyObject,
56 pub dict: *mut PyObject,
57 pub args: *mut PyObject,
58 #[cfg(Py_3_11)]
59 pub notes: *mut PyObject,
60 pub traceback: *mut PyObject,
61 pub context: *mut PyObject,
62 pub cause: *mut PyObject,
63 pub suppress_context: char,
64
65 pub msg: *mut PyObject,
66 pub name: *mut PyObject,
67 pub path: *mut PyObject,
68 #[cfg(Py_3_12)]
69 pub name_from: *mut PyObject,
70}
71
72#[cfg(not(PyPy))]
73#[repr(C)]
74#[derive(Debug)]
75pub struct PyUnicodeErrorObject {
76 pub ob_base: PyObject,
77 pub dict: *mut PyObject,
78 pub args: *mut PyObject,
79 #[cfg(Py_3_11)]
80 pub notes: *mut PyObject,
81 pub traceback: *mut PyObject,
82 pub context: *mut PyObject,
83 pub cause: *mut PyObject,
84 pub suppress_context: char,
85
86 pub encoding: *mut PyObject,
87 pub object: *mut PyObject,
88 pub start: Py_ssize_t,
89 pub end: Py_ssize_t,
90 pub reason: *mut PyObject,
91}
92
93#[cfg(not(PyPy))]
94#[repr(C)]
95#[derive(Debug)]
96pub struct PySystemExitObject {
97 pub ob_base: PyObject,
98 pub dict: *mut PyObject,
99 pub args: *mut PyObject,
100 #[cfg(Py_3_11)]
101 pub notes: *mut PyObject,
102 pub traceback: *mut PyObject,
103 pub context: *mut PyObject,
104 pub cause: *mut PyObject,
105 pub suppress_context: char,
106
107 pub code: *mut PyObject,
108}
109
110#[cfg(not(PyPy))]
111#[repr(C)]
112#[derive(Debug)]
113pub struct PyOSErrorObject {
114 pub ob_base: PyObject,
115 pub dict: *mut PyObject,
116 pub args: *mut PyObject,
117 #[cfg(Py_3_11)]
118 pub notes: *mut PyObject,
119 pub traceback: *mut PyObject,
120 pub context: *mut PyObject,
121 pub cause: *mut PyObject,
122 pub suppress_context: char,
123
124 pub myerrno: *mut PyObject,
125 pub strerror: *mut PyObject,
126 pub filename: *mut PyObject,
127 pub filename2: *mut PyObject,
128 #[cfg(windows)]
129 pub winerror: *mut PyObject,
130 pub written: Py_ssize_t,
131}
132
133#[repr(C)]
134#[derive(Debug)]
135pub struct PyStopIterationObject {
136 pub ob_base: PyObject,
137 #[cfg(not(PyPy))]
138 pub dict: *mut PyObject,
139 #[cfg(not(PyPy))]
140 pub args: *mut PyObject,
141 #[cfg(all(Py_3_11, not(PyPy)))]
142 pub notes: *mut PyObject,
143 #[cfg(not(PyPy))]
144 pub traceback: *mut PyObject,
145 #[cfg(not(PyPy))]
146 pub context: *mut PyObject,
147 #[cfg(not(PyPy))]
148 pub cause: *mut PyObject,
149 #[cfg(not(PyPy))]
150 pub suppress_context: char,
151
152 pub value: *mut PyObject,
153}
154
155extern "C" {
156 #[cfg(not(PyPy))]
157 pub fn _PyErr_ChainExceptions(typ: *mut PyObject, val: *mut PyObject, tb: *mut PyObject);
158}
159
160// skipped PyNameErrorObject
161// skipped PyAttributeErrorObject
162
163// skipped PyEnvironmentErrorObject
164// skipped PyWindowsErrorObject
165
166// skipped _PyErr_SetKeyError
167// skipped _PyErr_GetTopmostException
168// skipped _PyErr_GetExcInfo
169
170// skipped PyErr_SetFromErrnoWithUnicodeFilename
171
172// skipped _PyErr_FormatFromCause
173
174// skipped PyErr_SetFromWindowsErrWithUnicodeFilename
175// skipped PyErr_SetExcFromWindowsErrWithUnicodeFilename
176
177// skipped _PyErr_TrySetFromCause
178
179// skipped PySignal_SetWakeupFd
180// skipped _PyErr_CheckSignals
181
182// skipped PyErr_SyntaxLocationObject
183// skipped PyErr_RangedSyntaxLocationObject
184// skipped PyErr_ProgramTextObject
185
186// skipped _PyErr_ProgramDecodedTextObject
187// skipped _PyUnicodeTranslateError_Create
188// skipped _PyErr_WriteUnraisableMsg
189// skipped _Py_FatalErrorFunc
190// skipped _Py_FatalErrorFormat
191// skipped Py_FatalError
192