FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpython/Include/internal/pycore_pyerrors.h at main · python/cpython · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
python
/
cpython
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
35.3k
Star
74.9k
Code
Issues
5k+
Pull requests
2.6k
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpython
/
Include
/
internal
/
pycore_pyerrors.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
219 lines (169 loc) · 5.97 KB
Breadcrumbs
cpython
/
Include
/
internal
/
pycore_pyerrors.h
Copy path
File metadata and controls
219 lines (169 loc) · 5.97 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
#ifndef
Py_INTERNAL_PYERRORS_H
#define
Py_INTERNAL_PYERRORS_H
#ifdef
__cplusplus
extern
"C"
{
#endif
#ifndef
Py_BUILD_CORE
# error
"this header requires Py_BUILD_CORE define"
#endif
/* Error handling definitions */
PyAPI_FUNC
(
_PyErr_StackItem
*
)
_PyErr_GetTopmostException
(
PyThreadState
*
tstate
);
PyAPI_FUNC
(
PyObject
*
)
_PyErr_GetHandledException
(
PyThreadState
*
);
extern
void
_PyErr_SetHandledException
(
PyThreadState
*
,
PyObject
*
);
extern
void
_PyErr_GetExcInfo
(
PyThreadState
*
,
PyObject
*
*
,
PyObject
*
*
,
PyObject
*
*
);
// Export for '_testinternalcapi' shared extension
PyAPI_FUNC
(
void
)
_PyErr_SetKeyError
(
PyObject
*
);
// Like PyErr_Format(), but saves current exception as __context__ and
// __cause__.
// Export for '_sqlite3' shared extension.
PyAPI_FUNC
(
PyObject
*
)
_PyErr_FormatFromCause
(
PyObject
*
exception
,
const
char
*
format
,
/* ASCII-encoded string */
...
);
// Export for 'pyexpat' shared extension.
PyAPI_FUNC
(
int
)
_PyException_AddNote
(
PyObject
*
exc
,
PyObject
*
note
);
extern
int
_PyErr_CheckSignals
(
void
);
/* Support for adding program text to SyntaxErrors */
// Export for test_peg_generator
PyAPI_FUNC
(
PyObject
*
)
_PyErr_ProgramDecodedTextObject
(
PyObject
*
filename
,
int
lineno
,
const
char
*
encoding
);
extern
PyObject
*
_PyUnicodeTranslateError_Create
(
PyObject
*
object
,
Py_ssize_t
start
,
Py_ssize_t
end
,
const
char
*
reason
/* UTF-8 encoded string */
);
extern
void
_Py_NO_RETURN
_Py_FatalErrorFormat
(
const
char
*
func
,
const
char
*
format
,
...);
extern
PyObject
*
_PyErr_SetImportErrorWithNameFrom
(
PyObject
*
,
PyObject
*
,
PyObject
*
,
PyObject
*
);
extern
int
_PyErr_SetModuleNotFoundError
(
PyObject
*
name
);
/* runtime lifecycle */
extern
PyStatus
_PyErr_InitTypes
(
PyInterpreterState
*
);
extern
void
_PyErr_FiniTypes
(
PyInterpreterState
*
);
/* other API */
static
inline
PyObject
*
_PyErr_Occurred
(
PyThreadState
*
tstate
)
{
assert
(
tstate
!=
NULL
);
if
(
tstate
->
current_exception
==
NULL
) {
return
NULL
;
}
return
(
PyObject
*
)
Py_TYPE
(
tstate
->
current_exception
);
}
static
inline
void
_PyErr_ClearExcState
(
_PyErr_StackItem
*
exc_state
)
{
Py_CLEAR
(
exc_state
->
exc_value
);
}
extern
PyObject
*
_PyErr_StackItemToExcInfoTuple
(
_PyErr_StackItem
*
err_info
);
extern
void
_PyErr_Fetch
(
PyThreadState
*
tstate
,
PyObject
*
*
type
,
PyObject
*
*
value
,
PyObject
*
*
traceback
);
PyAPI_FUNC
(
PyObject
*
)
_PyErr_GetRaisedException
(
PyThreadState
*
tstate
);
PyAPI_FUNC
(
int
)
_PyErr_ExceptionMatches
(
PyThreadState
*
tstate
,
PyObject
*
exc
);
PyAPI_FUNC
(
void
)
_PyErr_SetRaisedException
(
PyThreadState
*
tstate
,
PyObject
*
exc
);
extern
void
_PyErr_Restore
(
PyThreadState
*
tstate
,
PyObject
*
type
,
PyObject
*
value
,
PyObject
*
traceback
);
PyAPI_FUNC
(
void
)
_PyErr_SetObject
(
PyThreadState
*
tstate
,
PyObject
*
type
,
PyObject
*
value
);
extern
void
_PyErr_ChainStackItem
(
void
);
extern
void
_PyErr_ChainExceptions1Tstate
(
PyThreadState
*
,
PyObject
*
);
PyAPI_FUNC
(
void
)
_PyErr_Clear
(
PyThreadState
*
tstate
);
extern
void
_PyErr_SetNone
(
PyThreadState
*
tstate
,
PyObject
*
exception
);
extern
PyObject
*
_PyErr_NoMemory
(
PyThreadState
*
tstate
);
// Export for test_peg_generator
PyAPI_FUNC
(
int
)
_PyErr_EmitSyntaxWarning
(
PyObject
*
msg
,
PyObject
*
filename
,
int
lineno
,
int
col_offset
,
int
end_lineno
,
int
end_col_offset
,
PyObject
*
module
);
extern
void
_PyErr_RaiseSyntaxError
(
PyObject
*
msg
,
PyObject
*
filename
,
int
lineno
,
int
col_offset
,
int
end_lineno
,
int
end_col_offset
);
PyAPI_FUNC
(
void
)
_PyErr_SetString
(
PyThreadState
*
tstate
,
PyObject
*
exception
,
const
char
*
string
);
/*
* Set an exception with the error message decoded from the current locale
* encoding (LC_CTYPE).
*
* Exceptions occurring in decoding take priority over the desired exception.
*
* Exported for '_ctypes' shared extensions.
*/
PyAPI_FUNC
(
void
)
_PyErr_SetLocaleString
(
PyObject
*
exception
,
const
char
*
string
);
PyAPI_FUNC
(
PyObject
*
)
_PyErr_Format
(
PyThreadState
*
tstate
,
PyObject
*
exception
,
const
char
*
format
,
...);
PyAPI_FUNC
(
PyObject
*
)
_PyErr_FormatV
(
PyThreadState
*
tstate
,
PyObject
*
exception
,
const
char
*
format
,
va_list
vargs
);
extern
void
_PyErr_NormalizeException
(
PyThreadState
*
tstate
,
PyObject
*
*
exc
,
PyObject
*
*
val
,
PyObject
*
*
tb
);
extern
PyObject
*
_PyErr_FormatFromCauseTstate
(
PyThreadState
*
tstate
,
PyObject
*
exception
,
const
char
*
format
,
...);
// Exported for external JIT support
PyAPI_FUNC
(
PyObject
*
)
_PyExc_CreateExceptionGroup
(
const
char
*
msg
,
PyObject
*
excs
);
extern
PyObject
*
_PyExc_PrepReraiseStar
(
PyObject
*
orig
,
PyObject
*
excs
);
extern
int
_PyErr_CheckSignalsTstate
(
PyThreadState
*
tstate
);
extern
void
_Py_DumpExtensionModules
(
int
fd
,
PyInterpreterState
*
interp
);
// Exported for external JIT support
PyAPI_FUNC
(
PyObject
*
)
_Py_CalculateSuggestions
(
PyObject
*
dir
,
PyObject
*
name
);
extern
PyObject
*
_Py_Offer_Suggestions
(
PyObject
*
exception
);
// Export for '_testinternalcapi' shared extension
PyAPI_FUNC
(
Py_ssize_t
)
_Py_UTF8_Edit_Cost
(
PyObject
*
str_a
,
PyObject
*
str_b
,
Py_ssize_t
max_cost
);
// Export for '_json' shared extension
PyAPI_FUNC
(
void
)
_PyErr_FormatNote
(
const
char
*
format
, ...);
/* Context manipulation (PEP 3134) */
Py_DEPRECATED
(
3.12
)
extern
void
_PyErr_ChainExceptions
(
PyObject
*
,
PyObject
*
,
PyObject
*
);
// implementation detail for the codeop module.
// Exported for test.test_peg_generator.test_c_parser
PyAPI_DATA
(
PyTypeObject
)
_PyExc_IncompleteInputError
;
#define
PyExc_IncompleteInputError
((PyObject *)(&_PyExc_IncompleteInputError))
extern
int
_PyUnicodeError_GetParams
(
PyObject
*
self
,
PyObject
*
*
obj
,
Py_ssize_t
*
objlen
,
Py_ssize_t
*
start
,
Py_ssize_t
*
end
,
Py_ssize_t
*
slen
,
int
as_bytes
);
#ifdef
__cplusplus
}
#endif
#endif
/* !Py_INTERNAL_PYERRORS_H */
Back
|
FazBrowse Home
|
New Git URL