| 1 |
/*[clinic input] |
| 2 |
preserve |
| 3 |
[clinic start generated code]*/ |
| 4 |
|
| 5 |
#include "pycore_critical_section.h"// Py_BEGIN_CRITICAL_SECTION() |
| 6 |
#include "pycore_modsupport.h" // _PyArg_BadArgument() |
| 7 |
|
| 8 |
PyDoc_STRVAR(BaseException___reduce____doc__, |
| 9 |
"__reduce__($self, /)\n" |
| 10 |
"--\n" |
| 11 |
"\n"); |
| 12 |
|
| 13 |
#define BASEEXCEPTION___REDUCE___METHODDEF \ |
| 14 |
{"__reduce__", (PyCFunction)BaseException___reduce__, METH_NOARGS, BaseException___reduce____doc__}, |
| 15 |
|
| 16 |
static PyObject * |
| 17 |
BaseException___reduce___impl(PyBaseExceptionObject *self); |
| 18 |
|
| 19 |
static PyObject * |
| 20 |
BaseException___reduce__(PyObject *self, PyObject *Py_UNUSED(ignored)) |
| 21 |
{ |
| 22 |
PyObject *return_value = NULL; |
| 23 |
|
| 24 |
Py_BEGIN_CRITICAL_SECTION(self); |
| 25 |
return_value = BaseException___reduce___impl((PyBaseExceptionObject *)self); |
| 26 |
Py_END_CRITICAL_SECTION(); |
| 27 |
|
| 28 |
return return_value; |
| 29 |
} |
| 30 |
|
| 31 |
PyDoc_STRVAR(BaseException___setstate____doc__, |
| 32 |
"__setstate__($self, state, /)\n" |
| 33 |
"--\n" |
| 34 |
"\n"); |
| 35 |
|
| 36 |
#define BASEEXCEPTION___SETSTATE___METHODDEF \ |
| 37 |
{"__setstate__", (PyCFunction)BaseException___setstate__, METH_O, BaseException___setstate____doc__}, |
| 38 |
|
| 39 |
static PyObject * |
| 40 |
BaseException___setstate___impl(PyBaseExceptionObject *self, PyObject *state); |
| 41 |
|
| 42 |
static PyObject * |
| 43 |
BaseException___setstate__(PyObject *self, PyObject *state) |
| 44 |
{ |
| 45 |
PyObject *return_value = NULL; |
| 46 |
|
| 47 |
Py_BEGIN_CRITICAL_SECTION(self); |
| 48 |
return_value = BaseException___setstate___impl((PyBaseExceptionObject *)self, state); |
| 49 |
Py_END_CRITICAL_SECTION(); |
| 50 |
|
| 51 |
return return_value; |
| 52 |
} |
| 53 |
|
| 54 |
PyDoc_STRVAR(BaseException_with_traceback__doc__, |
| 55 |
"with_traceback($self, tb, /)\n" |
| 56 |
"--\n" |
| 57 |
"\n" |
| 58 |
"Set self.__traceback__ to tb and return self."); |
| 59 |
|
| 60 |
#define BASEEXCEPTION_WITH_TRACEBACK_METHODDEF \ |
| 61 |
{"with_traceback", (PyCFunction)BaseException_with_traceback, METH_O, BaseException_with_traceback__doc__}, |
| 62 |
|
| 63 |
static PyObject * |
| 64 |
BaseException_with_traceback_impl(PyBaseExceptionObject *self, PyObject *tb); |
| 65 |
|
| 66 |
static PyObject * |
| 67 |
BaseException_with_traceback(PyObject *self, PyObject *tb) |
| 68 |
{ |
| 69 |
PyObject *return_value = NULL; |
| 70 |
|
| 71 |
Py_BEGIN_CRITICAL_SECTION(self); |
| 72 |
return_value = BaseException_with_traceback_impl((PyBaseExceptionObject *)self, tb); |
| 73 |
Py_END_CRITICAL_SECTION(); |
| 74 |
|
| 75 |
return return_value; |
| 76 |
} |
| 77 |
|
| 78 |
PyDoc_STRVAR(BaseException_add_note__doc__, |
| 79 |
"add_note($self, note, /)\n" |
| 80 |
"--\n" |
| 81 |
"\n" |
| 82 |
"Add a note to the exception"); |
| 83 |
|
| 84 |
#define BASEEXCEPTION_ADD_NOTE_METHODDEF \ |
| 85 |
{"add_note", (PyCFunction)BaseException_add_note, METH_O, BaseException_add_note__doc__}, |
| 86 |
|
| 87 |
static PyObject * |
| 88 |
BaseException_add_note_impl(PyBaseExceptionObject *self, PyObject *note); |
| 89 |
|
| 90 |
static PyObject * |
| 91 |
BaseException_add_note(PyObject *self, PyObject *arg) |
| 92 |
{ |
| 93 |
PyObject *return_value = NULL; |
| 94 |
PyObject *note; |
| 95 |
|
| 96 |
if (!PyUnicode_Check(arg)) { |
| 97 |
_PyArg_BadArgument("add_note", "argument", "str", arg); |
| 98 |
goto exit; |
| 99 |
} |
| 100 |
note = arg; |
| 101 |
Py_BEGIN_CRITICAL_SECTION(self); |
| 102 |
return_value = BaseException_add_note_impl((PyBaseExceptionObject *)self, note); |
| 103 |
Py_END_CRITICAL_SECTION(); |
| 104 |
|
| 105 |
exit: |
| 106 |
return return_value; |
| 107 |
} |
| 108 |
|
| 109 |
#if !defined(BaseException_args_DOCSTR) |
| 110 |
# define BaseException_args_DOCSTR NULL |
| 111 |
#endif |
| 112 |
#if defined(BASEEXCEPTION_ARGS_GETSETDEF) |
| 113 |
# undef BASEEXCEPTION_ARGS_GETSETDEF |
| 114 |
# define BASEEXCEPTION_ARGS_GETSETDEF {"args", (getter)BaseException_args_get, (setter)BaseException_args_set, BaseException_args_DOCSTR}, |
| 115 |
#else |
| 116 |
# define BASEEXCEPTION_ARGS_GETSETDEF {"args", (getter)BaseException_args_get, NULL, BaseException_args_DOCSTR}, |
| 117 |
#endif |
| 118 |
|
| 119 |
static PyObject * |
| 120 |
BaseException_args_get_impl(PyBaseExceptionObject *self); |
| 121 |
|
| 122 |
static PyObject * |
| 123 |
BaseException_args_get(PyObject *self, void *Py_UNUSED(context)) |
| 124 |
{ |
| 125 |
PyObject *return_value = NULL; |
| 126 |
|
| 127 |
Py_BEGIN_CRITICAL_SECTION(self); |
| 128 |
return_value = BaseException_args_get_impl((PyBaseExceptionObject *)self); |
| 129 |
Py_END_CRITICAL_SECTION(); |
| 130 |
|
| 131 |
return return_value; |
| 132 |
} |
| 133 |
|
| 134 |
#if !defined(BaseException_args_DOCSTR) |
| 135 |
# define BaseException_args_DOCSTR NULL |
| 136 |
#endif |
| 137 |
#if defined(BASEEXCEPTION_ARGS_GETSETDEF) |
| 138 |
# undef BASEEXCEPTION_ARGS_GETSETDEF |
| 139 |
# define BASEEXCEPTION_ARGS_GETSETDEF {"args", (getter)BaseException_args_get, (setter)BaseException_args_set, BaseException_args_DOCSTR}, |
| 140 |
#else |
| 141 |
# define BASEEXCEPTION_ARGS_GETSETDEF {"args", NULL, (setter)BaseException_args_set, NULL}, |
| 142 |
#endif |
| 143 |
|
| 144 |
static int |
| 145 |
BaseException_args_set_impl(PyBaseExceptionObject *self, PyObject *value); |
| 146 |
|
| 147 |
static int |
| 148 |
BaseException_args_set(PyObject *self, PyObject *value, void *Py_UNUSED(context)) |
| 149 |
{ |
| 150 |
int return_value; |
| 151 |
|
| 152 |
Py_BEGIN_CRITICAL_SECTION(self); |
| 153 |
return_value = BaseException_args_set_impl((PyBaseExceptionObject *)self, value); |
| 154 |
Py_END_CRITICAL_SECTION(); |
| 155 |
|
| 156 |
return return_value; |
| 157 |
} |
| 158 |
|
| 159 |
#if !defined(BaseException___traceback___DOCSTR) |
| 160 |
# define BaseException___traceback___DOCSTR NULL |
| 161 |
#endif |
| 162 |
#if defined(BASEEXCEPTION___TRACEBACK___GETSETDEF) |
| 163 |
# undef BASEEXCEPTION___TRACEBACK___GETSETDEF |
| 164 |
# define BASEEXCEPTION___TRACEBACK___GETSETDEF {"__traceback__", (getter)BaseException___traceback___get, (setter)BaseException___traceback___set, BaseException___traceback___DOCSTR}, |
| 165 |
#else |
| 166 |
# define BASEEXCEPTION___TRACEBACK___GETSETDEF {"__traceback__", (getter)BaseException___traceback___get, NULL, BaseException___traceback___DOCSTR}, |
| 167 |
#endif |
| 168 |
|
| 169 |
static PyObject * |
| 170 |
BaseException___traceback___get_impl(PyBaseExceptionObject *self); |
| 171 |
|
| 172 |
static PyObject * |
| 173 |
BaseException___traceback___get(PyObject *self, void *Py_UNUSED(context)) |
| 174 |
{ |
| 175 |
PyObject *return_value = NULL; |
| 176 |
|
| 177 |
Py_BEGIN_CRITICAL_SECTION(self); |
| 178 |
return_value = BaseException___traceback___get_impl((PyBaseExceptionObject *)self); |
| 179 |
Py_END_CRITICAL_SECTION(); |
| 180 |
|
| 181 |
return return_value; |
| 182 |
} |
| 183 |
|
| 184 |
#if !defined(BaseException___traceback___DOCSTR) |
| 185 |
# define BaseException___traceback___DOCSTR NULL |
| 186 |
#endif |
| 187 |
#if defined(BASEEXCEPTION___TRACEBACK___GETSETDEF) |
| 188 |
# undef BASEEXCEPTION___TRACEBACK___GETSETDEF |
| 189 |
# define BASEEXCEPTION___TRACEBACK___GETSETDEF {"__traceback__", (getter)BaseException___traceback___get, (setter)BaseException___traceback___set, BaseException___traceback___DOCSTR}, |
| 190 |
#else |
| 191 |
# define BASEEXCEPTION___TRACEBACK___GETSETDEF {"__traceback__", NULL, (setter)BaseException___traceback___set, NULL}, |
| 192 |
#endif |
| 193 |
|
| 194 |
static int |
| 195 |
BaseException___traceback___set_impl(PyBaseExceptionObject *self, |
| 196 |
PyObject *value); |
| 197 |
|
| 198 |
static int |
| 199 |
BaseException___traceback___set(PyObject *self, PyObject *value, void *Py_UNUSED(context)) |
| 200 |
{ |
| 201 |
int return_value; |
| 202 |
|
| 203 |
Py_BEGIN_CRITICAL_SECTION(self); |
| 204 |
return_value = BaseException___traceback___set_impl((PyBaseExceptionObject *)self, value); |
| 205 |
Py_END_CRITICAL_SECTION(); |
| 206 |
|
| 207 |
return return_value; |
| 208 |
} |
| 209 |
|
| 210 |
#if !defined(BaseException___context___DOCSTR) |
| 211 |
# define BaseException___context___DOCSTR NULL |
| 212 |
#endif |
| 213 |
#if defined(BASEEXCEPTION___CONTEXT___GETSETDEF) |
| 214 |
# undef BASEEXCEPTION___CONTEXT___GETSETDEF |
| 215 |
# define BASEEXCEPTION___CONTEXT___GETSETDEF {"__context__", (getter)BaseException___context___get, (setter)BaseException___context___set, BaseException___context___DOCSTR}, |
| 216 |
#else |
| 217 |
# define BASEEXCEPTION___CONTEXT___GETSETDEF {"__context__", (getter)BaseException___context___get, NULL, BaseException___context___DOCSTR}, |
| 218 |
#endif |
| 219 |
|
| 220 |
static PyObject * |
| 221 |
BaseException___context___get_impl(PyBaseExceptionObject *self); |
| 222 |
|
| 223 |
static PyObject * |
| 224 |
BaseException___context___get(PyObject *self, void *Py_UNUSED(context)) |
| 225 |
{ |
| 226 |
PyObject *return_value = NULL; |
| 227 |
|
| 228 |
Py_BEGIN_CRITICAL_SECTION(self); |
| 229 |
return_value = BaseException___context___get_impl((PyBaseExceptionObject *)self); |
| 230 |
Py_END_CRITICAL_SECTION(); |
| 231 |
|
| 232 |
return return_value; |
| 233 |
} |
| 234 |
|
| 235 |
#if !defined(BaseException___context___DOCSTR) |
| 236 |
# define BaseException___context___DOCSTR NULL |
| 237 |
#endif |
| 238 |
#if defined(BASEEXCEPTION___CONTEXT___GETSETDEF) |
| 239 |
# undef BASEEXCEPTION___CONTEXT___GETSETDEF |
| 240 |
# define BASEEXCEPTION___CONTEXT___GETSETDEF {"__context__", (getter)BaseException___context___get, (setter)BaseException___context___set, BaseException___context___DOCSTR}, |
| 241 |
#else |
| 242 |
# define BASEEXCEPTION___CONTEXT___GETSETDEF {"__context__", NULL, (setter)BaseException___context___set, NULL}, |
| 243 |
#endif |
| 244 |
|
| 245 |
static int |
| 246 |
BaseException___context___set_impl(PyBaseExceptionObject *self, |
| 247 |
PyObject *value); |
| 248 |
|
| 249 |
static int |
| 250 |
BaseException___context___set(PyObject *self, PyObject *value, void *Py_UNUSED(context)) |
| 251 |
{ |
| 252 |
int return_value; |
| 253 |
|
| 254 |
Py_BEGIN_CRITICAL_SECTION(self); |
| 255 |
return_value = BaseException___context___set_impl((PyBaseExceptionObject *)self, value); |
| 256 |
Py_END_CRITICAL_SECTION(); |
| 257 |
|
| 258 |
return return_value; |
| 259 |
} |
| 260 |
|
| 261 |
#if !defined(BaseException___cause___DOCSTR) |
| 262 |
# define BaseException___cause___DOCSTR NULL |
| 263 |
#endif |
| 264 |
#if defined(BASEEXCEPTION___CAUSE___GETSETDEF) |
| 265 |
# undef BASEEXCEPTION___CAUSE___GETSETDEF |
| 266 |
# define BASEEXCEPTION___CAUSE___GETSETDEF {"__cause__", (getter)BaseException___cause___get, (setter)BaseException___cause___set, BaseException___cause___DOCSTR}, |
| 267 |
#else |
| 268 |
# define BASEEXCEPTION___CAUSE___GETSETDEF {"__cause__", (getter)BaseException___cause___get, NULL, BaseException___cause___DOCSTR}, |
| 269 |
#endif |
| 270 |
|
| 271 |
static PyObject * |
| 272 |
BaseException___cause___get_impl(PyBaseExceptionObject *self); |
| 273 |
|
| 274 |
static PyObject * |
| 275 |
BaseException___cause___get(PyObject *self, void *Py_UNUSED(context)) |
| 276 |
{ |
| 277 |
PyObject *return_value = NULL; |
| 278 |
|
| 279 |
Py_BEGIN_CRITICAL_SECTION(self); |
| 280 |
return_value = BaseException___cause___get_impl((PyBaseExceptionObject *)self); |
| 281 |
Py_END_CRITICAL_SECTION(); |
| 282 |
|
| 283 |
return return_value; |
| 284 |
} |
| 285 |
|
| 286 |
#if !defined(BaseException___cause___DOCSTR) |
| 287 |
# define BaseException___cause___DOCSTR NULL |
| 288 |
#endif |
| 289 |
#if defined(BASEEXCEPTION___CAUSE___GETSETDEF) |
| 290 |
# undef BASEEXCEPTION___CAUSE___GETSETDEF |
| 291 |
# define BASEEXCEPTION___CAUSE___GETSETDEF {"__cause__", (getter)BaseException___cause___get, (setter)BaseException___cause___set, BaseException___cause___DOCSTR}, |
| 292 |
#else |
| 293 |
# define BASEEXCEPTION___CAUSE___GETSETDEF {"__cause__", NULL, (setter)BaseException___cause___set, NULL}, |
| 294 |
#endif |
| 295 |
|
| 296 |
static int |
| 297 |
BaseException___cause___set_impl(PyBaseExceptionObject *self, |
| 298 |
PyObject *value); |
| 299 |
|
| 300 |
static int |
| 301 |
BaseException___cause___set(PyObject *self, PyObject *value, void *Py_UNUSED(context)) |
| 302 |
{ |
| 303 |
int return_value; |
| 304 |
|
| 305 |
Py_BEGIN_CRITICAL_SECTION(self); |
| 306 |
return_value = BaseException___cause___set_impl((PyBaseExceptionObject *)self, value); |
| 307 |
Py_END_CRITICAL_SECTION(); |
| 308 |
|
| 309 |
return return_value; |
| 310 |
} |
| 311 |
|
| 312 |
PyDoc_STRVAR(BaseExceptionGroup_derive__doc__, |
| 313 |
"derive($self, excs, /)\n" |
| 314 |
"--\n" |
| 315 |
"\n"); |
| 316 |
|
| 317 |
#define BASEEXCEPTIONGROUP_DERIVE_METHODDEF \ |
| 318 |
{"derive", (PyCFunction)BaseExceptionGroup_derive, METH_O, BaseExceptionGroup_derive__doc__}, |
| 319 |
|
| 320 |
static PyObject * |
| 321 |
BaseExceptionGroup_derive_impl(PyBaseExceptionGroupObject *self, |
| 322 |
PyObject *excs); |
| 323 |
|
| 324 |
static PyObject * |
| 325 |
BaseExceptionGroup_derive(PyObject *self, PyObject *excs) |
| 326 |
{ |
| 327 |
PyObject *return_value = NULL; |
| 328 |
|
| 329 |
Py_BEGIN_CRITICAL_SECTION(self); |
| 330 |
return_value = BaseExceptionGroup_derive_impl((PyBaseExceptionGroupObject *)self, excs); |
| 331 |
Py_END_CRITICAL_SECTION(); |
| 332 |
|
| 333 |
return return_value; |
| 334 |
} |
| 335 |
|
| 336 |
PyDoc_STRVAR(BaseExceptionGroup_split__doc__, |
| 337 |
"split($self, matcher_value, /)\n" |
| 338 |
"--\n" |
| 339 |
"\n"); |
| 340 |
|
| 341 |
#define BASEEXCEPTIONGROUP_SPLIT_METHODDEF \ |
| 342 |
{"split", (PyCFunction)BaseExceptionGroup_split, METH_O, BaseExceptionGroup_split__doc__}, |
| 343 |
|
| 344 |
static PyObject * |
| 345 |
BaseExceptionGroup_split_impl(PyBaseExceptionGroupObject *self, |
| 346 |
PyObject *matcher_value); |
| 347 |
|
| 348 |
static PyObject * |
| 349 |
BaseExceptionGroup_split(PyObject *self, PyObject *matcher_value) |
| 350 |
{ |
| 351 |
PyObject *return_value = NULL; |
| 352 |
|
| 353 |
Py_BEGIN_CRITICAL_SECTION(self); |
| 354 |
return_value = BaseExceptionGroup_split_impl((PyBaseExceptionGroupObject *)self, matcher_value); |
| 355 |
Py_END_CRITICAL_SECTION(); |
| 356 |
|
| 357 |
return return_value; |
| 358 |
} |
| 359 |
|
| 360 |
PyDoc_STRVAR(BaseExceptionGroup_subgroup__doc__, |
| 361 |
"subgroup($self, matcher_value, /)\n" |
| 362 |
"--\n" |
| 363 |
"\n"); |
| 364 |
|
| 365 |
#define BASEEXCEPTIONGROUP_SUBGROUP_METHODDEF \ |
| 366 |
{"subgroup", (PyCFunction)BaseExceptionGroup_subgroup, METH_O, BaseExceptionGroup_subgroup__doc__}, |
| 367 |
|
| 368 |
static PyObject * |
| 369 |
BaseExceptionGroup_subgroup_impl(PyBaseExceptionGroupObject *self, |
| 370 |
PyObject *matcher_value); |
| 371 |
|
| 372 |
static PyObject * |
| 373 |
BaseExceptionGroup_subgroup(PyObject *self, PyObject *matcher_value) |
| 374 |
{ |
| 375 |
PyObject *return_value = NULL; |
| 376 |
|
| 377 |
Py_BEGIN_CRITICAL_SECTION(self); |
| 378 |
return_value = BaseExceptionGroup_subgroup_impl((PyBaseExceptionGroupObject *)self, matcher_value); |
| 379 |
Py_END_CRITICAL_SECTION(); |
| 380 |
|
| 381 |
return return_value; |
| 382 |
} |
| 383 |
/*[clinic end generated code: output=fcf70b3b71f3d14a input=a9049054013a1b77]*/ |