/
pyerrors.rs
124 lines (106 loc) · 2.86 KB
/
pyerrors.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
use crate::PyObject;
#[cfg(not(PyPy))]
use crate::Py_ssize_t;
#[repr(C)]
#[derive(Debug)]
pub struct PyBaseExceptionObject {
pub ob_base: PyObject,
#[cfg(not(PyPy))]
pub dict: *mut PyObject,
#[cfg(not(PyPy))]
pub args: *mut PyObject,
#[cfg(not(PyPy))]
pub traceback: *mut PyObject,
#[cfg(not(PyPy))]
pub context: *mut PyObject,
#[cfg(not(PyPy))]
pub cause: *mut PyObject,
#[cfg(not(PyPy))]
pub suppress_context: char,
}
#[cfg(not(PyPy))]
#[repr(C)]
#[derive(Debug)]
pub struct PySyntaxErrorObject {
pub exception_base: PyBaseExceptionObject,
pub msg: *mut PyObject,
pub filename: *mut PyObject,
pub lineno: *mut PyObject,
pub offset: *mut PyObject,
#[cfg(Py_3_10)]
pub end_lineno: *mut PyObject,
#[cfg(Py_3_10)]
pub end_offset: *mut PyObject,
pub text: *mut PyObject,
pub print_file_and_line: *mut PyObject,
}
#[cfg(not(PyPy))]
#[repr(C)]
#[derive(Debug)]
pub struct PyImportErrorObject {
pub exception_base: PyBaseExceptionObject,
pub msg: *mut PyObject,
pub name: *mut PyObject,
pub path: *mut PyObject,
}
#[cfg(not(PyPy))]
#[repr(C)]
#[derive(Debug)]
pub struct PyUnicodeErrorObject {
pub exception_base: PyBaseExceptionObject,
pub encoding: *mut PyObject,
pub object: *mut PyObject,
pub start: Py_ssize_t,
pub end: Py_ssize_t,
pub reason: *mut PyObject,
}
#[cfg(not(PyPy))]
#[repr(C)]
#[derive(Debug)]
pub struct PySystemExitObject {
pub exception_base: PyBaseExceptionObject,
pub code: *mut PyObject,
}
#[cfg(not(PyPy))]
#[repr(C)]
#[derive(Debug)]
pub struct PyOSErrorObject {
pub exception_base: PyBaseExceptionObject,
pub myerrno: *mut PyObject,
pub strerror: *mut PyObject,
pub filename: *mut PyObject,
pub filename2: *mut PyObject,
#[cfg(windows)]
pub winerror: *mut PyObject,
pub written: Py_ssize_t,
}
#[repr(C)]
#[derive(Debug)]
pub struct PyStopIterationObject {
pub exception_base: PyBaseExceptionObject,
pub value: *mut PyObject,
}
// skipped PyNameErrorObject
// skipped PyAttributeErrorObject
// skipped PyEnvironmentErrorObject
// skipped PyWindowsErrorObject
// skipped _PyErr_SetKeyError
// skipped _PyErr_GetTopmostException
// skipped _PyErr_GetExcInfo
// skipped _PyErr_ChainExceptions
// skipped PyErr_SetFromErrnoWithUnicodeFilename
// skipped _PyErr_FormatFromCause
// skipped PyErr_SetFromWindowsErrWithUnicodeFilename
// skipped PyErr_SetExcFromWindowsErrWithUnicodeFilename
// skipped _PyErr_TrySetFromCause
// skipped PySignal_SetWakeupFd
// skipped _PyErr_CheckSignals
// skipped PyErr_SyntaxLocationObject
// skipped PyErr_RangedSyntaxLocationObject
// skipped PyErr_ProgramTextObject
// skipped _PyErr_ProgramDecodedTextObject
// skipped _PyUnicodeTranslateError_Create
// skipped _PyErr_WriteUnraisableMsg
// skipped _Py_FatalErrorFunc
// skipped _Py_FatalErrorFormat
// skipped Py_FatalError