gh-111178: Regen clinic and fix exceptions.c post gh-128447 (#129060)

This commit is contained in:
Erlend E. Aasland 2025-01-20 13:46:30 +01:00 committed by GitHub
parent a30277a06a
commit da0f47ceab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 24 deletions

View file

@ -17,12 +17,12 @@ static PyObject *
BaseException___reduce___impl(PyBaseExceptionObject *self); BaseException___reduce___impl(PyBaseExceptionObject *self);
static PyObject * static PyObject *
BaseException___reduce__(PyBaseExceptionObject *self, PyObject *Py_UNUSED(ignored)) BaseException___reduce__(PyObject *self, PyObject *Py_UNUSED(ignored))
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_BEGIN_CRITICAL_SECTION(self); Py_BEGIN_CRITICAL_SECTION(self);
return_value = BaseException___reduce___impl(self); return_value = BaseException___reduce___impl((PyBaseExceptionObject *)self);
Py_END_CRITICAL_SECTION(); Py_END_CRITICAL_SECTION();
return return_value; return return_value;
@ -45,7 +45,7 @@ BaseException___setstate__(PyBaseExceptionObject *self, PyObject *state)
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_BEGIN_CRITICAL_SECTION(self); Py_BEGIN_CRITICAL_SECTION(self);
return_value = BaseException___setstate___impl(self, state); return_value = BaseException___setstate___impl((PyBaseExceptionObject *)self, state);
Py_END_CRITICAL_SECTION(); Py_END_CRITICAL_SECTION();
return return_value; return return_value;
@ -69,7 +69,7 @@ BaseException_with_traceback(PyBaseExceptionObject *self, PyObject *tb)
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_BEGIN_CRITICAL_SECTION(self); Py_BEGIN_CRITICAL_SECTION(self);
return_value = BaseException_with_traceback_impl(self, tb); return_value = BaseException_with_traceback_impl((PyBaseExceptionObject *)self, tb);
Py_END_CRITICAL_SECTION(); Py_END_CRITICAL_SECTION();
return return_value; return return_value;
@ -88,7 +88,7 @@ static PyObject *
BaseException_add_note_impl(PyBaseExceptionObject *self, PyObject *note); BaseException_add_note_impl(PyBaseExceptionObject *self, PyObject *note);
static PyObject * static PyObject *
BaseException_add_note(PyBaseExceptionObject *self, PyObject *arg) BaseException_add_note(PyObject *self, PyObject *arg)
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
PyObject *note; PyObject *note;
@ -99,7 +99,7 @@ BaseException_add_note(PyBaseExceptionObject *self, PyObject *arg)
} }
note = arg; note = arg;
Py_BEGIN_CRITICAL_SECTION(self); Py_BEGIN_CRITICAL_SECTION(self);
return_value = BaseException_add_note_impl(self, note); return_value = BaseException_add_note_impl((PyBaseExceptionObject *)self, note);
Py_END_CRITICAL_SECTION(); Py_END_CRITICAL_SECTION();
exit: exit:
@ -120,12 +120,12 @@ static PyObject *
BaseException_args_get_impl(PyBaseExceptionObject *self); BaseException_args_get_impl(PyBaseExceptionObject *self);
static PyObject * static PyObject *
BaseException_args_get(PyBaseExceptionObject *self, void *Py_UNUSED(context)) BaseException_args_get(PyObject *self, void *Py_UNUSED(context))
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_BEGIN_CRITICAL_SECTION(self); Py_BEGIN_CRITICAL_SECTION(self);
return_value = BaseException_args_get_impl(self); return_value = BaseException_args_get_impl((PyBaseExceptionObject *)self);
Py_END_CRITICAL_SECTION(); Py_END_CRITICAL_SECTION();
return return_value; return return_value;
@ -145,12 +145,12 @@ static int
BaseException_args_set_impl(PyBaseExceptionObject *self, PyObject *value); BaseException_args_set_impl(PyBaseExceptionObject *self, PyObject *value);
static int static int
BaseException_args_set(PyBaseExceptionObject *self, PyObject *value, void *Py_UNUSED(context)) BaseException_args_set(PyObject *self, PyObject *value, void *Py_UNUSED(context))
{ {
int return_value; int return_value;
Py_BEGIN_CRITICAL_SECTION(self); Py_BEGIN_CRITICAL_SECTION(self);
return_value = BaseException_args_set_impl(self, value); return_value = BaseException_args_set_impl((PyBaseExceptionObject *)self, value);
Py_END_CRITICAL_SECTION(); Py_END_CRITICAL_SECTION();
return return_value; return return_value;
@ -170,12 +170,12 @@ static PyObject *
BaseException___traceback___get_impl(PyBaseExceptionObject *self); BaseException___traceback___get_impl(PyBaseExceptionObject *self);
static PyObject * static PyObject *
BaseException___traceback___get(PyBaseExceptionObject *self, void *Py_UNUSED(context)) BaseException___traceback___get(PyObject *self, void *Py_UNUSED(context))
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_BEGIN_CRITICAL_SECTION(self); Py_BEGIN_CRITICAL_SECTION(self);
return_value = BaseException___traceback___get_impl(self); return_value = BaseException___traceback___get_impl((PyBaseExceptionObject *)self);
Py_END_CRITICAL_SECTION(); Py_END_CRITICAL_SECTION();
return return_value; return return_value;
@ -196,12 +196,12 @@ BaseException___traceback___set_impl(PyBaseExceptionObject *self,
PyObject *value); PyObject *value);
static int static int
BaseException___traceback___set(PyBaseExceptionObject *self, PyObject *value, void *Py_UNUSED(context)) BaseException___traceback___set(PyObject *self, PyObject *value, void *Py_UNUSED(context))
{ {
int return_value; int return_value;
Py_BEGIN_CRITICAL_SECTION(self); Py_BEGIN_CRITICAL_SECTION(self);
return_value = BaseException___traceback___set_impl(self, value); return_value = BaseException___traceback___set_impl((PyBaseExceptionObject *)self, value);
Py_END_CRITICAL_SECTION(); Py_END_CRITICAL_SECTION();
return return_value; return return_value;
@ -221,12 +221,12 @@ static PyObject *
BaseException___context___get_impl(PyBaseExceptionObject *self); BaseException___context___get_impl(PyBaseExceptionObject *self);
static PyObject * static PyObject *
BaseException___context___get(PyBaseExceptionObject *self, void *Py_UNUSED(context)) BaseException___context___get(PyObject *self, void *Py_UNUSED(context))
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_BEGIN_CRITICAL_SECTION(self); Py_BEGIN_CRITICAL_SECTION(self);
return_value = BaseException___context___get_impl(self); return_value = BaseException___context___get_impl((PyBaseExceptionObject *)self);
Py_END_CRITICAL_SECTION(); Py_END_CRITICAL_SECTION();
return return_value; return return_value;
@ -247,12 +247,12 @@ BaseException___context___set_impl(PyBaseExceptionObject *self,
PyObject *value); PyObject *value);
static int static int
BaseException___context___set(PyBaseExceptionObject *self, PyObject *value, void *Py_UNUSED(context)) BaseException___context___set(PyObject *self, PyObject *value, void *Py_UNUSED(context))
{ {
int return_value; int return_value;
Py_BEGIN_CRITICAL_SECTION(self); Py_BEGIN_CRITICAL_SECTION(self);
return_value = BaseException___context___set_impl(self, value); return_value = BaseException___context___set_impl((PyBaseExceptionObject *)self, value);
Py_END_CRITICAL_SECTION(); Py_END_CRITICAL_SECTION();
return return_value; return return_value;
@ -272,12 +272,12 @@ static PyObject *
BaseException___cause___get_impl(PyBaseExceptionObject *self); BaseException___cause___get_impl(PyBaseExceptionObject *self);
static PyObject * static PyObject *
BaseException___cause___get(PyBaseExceptionObject *self, void *Py_UNUSED(context)) BaseException___cause___get(PyObject *self, void *Py_UNUSED(context))
{ {
PyObject *return_value = NULL; PyObject *return_value = NULL;
Py_BEGIN_CRITICAL_SECTION(self); Py_BEGIN_CRITICAL_SECTION(self);
return_value = BaseException___cause___get_impl(self); return_value = BaseException___cause___get_impl((PyBaseExceptionObject *)self);
Py_END_CRITICAL_SECTION(); Py_END_CRITICAL_SECTION();
return return_value; return return_value;
@ -298,14 +298,14 @@ BaseException___cause___set_impl(PyBaseExceptionObject *self,
PyObject *value); PyObject *value);
static int static int
BaseException___cause___set(PyBaseExceptionObject *self, PyObject *value, void *Py_UNUSED(context)) BaseException___cause___set(PyObject *self, PyObject *value, void *Py_UNUSED(context))
{ {
int return_value; int return_value;
Py_BEGIN_CRITICAL_SECTION(self); Py_BEGIN_CRITICAL_SECTION(self);
return_value = BaseException___cause___set_impl(self, value); return_value = BaseException___cause___set_impl((PyBaseExceptionObject *)self, value);
Py_END_CRITICAL_SECTION(); Py_END_CRITICAL_SECTION();
return return_value; return return_value;
} }
/*[clinic end generated code: output=58afcfd60057fc39 input=a9049054013a1b77]*/ /*[clinic end generated code: output=8be99f8a7e527ba4 input=a9049054013a1b77]*/

View file

@ -4256,7 +4256,7 @@ _PyException_AddNote(PyObject *exc, PyObject *note)
Py_TYPE(exc)->tp_name); Py_TYPE(exc)->tp_name);
return -1; return -1;
} }
PyObject *r = BaseException_add_note(_PyBaseExceptionObject_cast(exc), note); PyObject *r = BaseException_add_note(exc, note);
int res = r == NULL ? -1 : 0; int res = r == NULL ? -1 : 0;
Py_XDECREF(r); Py_XDECREF(r);
return res; return res;