From da0f47ceabd5c3f334265d8abe5ce1ba3d5bcf0e Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Mon, 20 Jan 2025 13:46:30 +0100 Subject: [PATCH] gh-111178: Regen clinic and fix exceptions.c post gh-128447 (#129060) --- Objects/clinic/exceptions.c.h | 46 +++++++++++++++++------------------ Objects/exceptions.c | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Objects/clinic/exceptions.c.h b/Objects/clinic/exceptions.c.h index caa5b0c63e53c5..3bd9a8553ab2fc 100644 --- a/Objects/clinic/exceptions.c.h +++ b/Objects/clinic/exceptions.c.h @@ -17,12 +17,12 @@ static PyObject * BaseException___reduce___impl(PyBaseExceptionObject *self); static PyObject * -BaseException___reduce__(PyBaseExceptionObject *self, PyObject *Py_UNUSED(ignored)) +BaseException___reduce__(PyObject *self, PyObject *Py_UNUSED(ignored)) { PyObject *return_value = NULL; Py_BEGIN_CRITICAL_SECTION(self); - return_value = BaseException___reduce___impl(self); + return_value = BaseException___reduce___impl((PyBaseExceptionObject *)self); Py_END_CRITICAL_SECTION(); return return_value; @@ -45,7 +45,7 @@ BaseException___setstate__(PyBaseExceptionObject *self, PyObject *state) PyObject *return_value = NULL; Py_BEGIN_CRITICAL_SECTION(self); - return_value = BaseException___setstate___impl(self, state); + return_value = BaseException___setstate___impl((PyBaseExceptionObject *)self, state); Py_END_CRITICAL_SECTION(); return return_value; @@ -69,7 +69,7 @@ BaseException_with_traceback(PyBaseExceptionObject *self, PyObject *tb) PyObject *return_value = NULL; 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(); return return_value; @@ -88,7 +88,7 @@ static PyObject * BaseException_add_note_impl(PyBaseExceptionObject *self, PyObject *note); static PyObject * -BaseException_add_note(PyBaseExceptionObject *self, PyObject *arg) +BaseException_add_note(PyObject *self, PyObject *arg) { PyObject *return_value = NULL; PyObject *note; @@ -99,7 +99,7 @@ BaseException_add_note(PyBaseExceptionObject *self, PyObject *arg) } note = arg; 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(); exit: @@ -120,12 +120,12 @@ static PyObject * BaseException_args_get_impl(PyBaseExceptionObject *self); static PyObject * -BaseException_args_get(PyBaseExceptionObject *self, void *Py_UNUSED(context)) +BaseException_args_get(PyObject *self, void *Py_UNUSED(context)) { PyObject *return_value = NULL; Py_BEGIN_CRITICAL_SECTION(self); - return_value = BaseException_args_get_impl(self); + return_value = BaseException_args_get_impl((PyBaseExceptionObject *)self); Py_END_CRITICAL_SECTION(); return return_value; @@ -145,12 +145,12 @@ static int BaseException_args_set_impl(PyBaseExceptionObject *self, PyObject *value); 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; 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(); return return_value; @@ -170,12 +170,12 @@ static PyObject * BaseException___traceback___get_impl(PyBaseExceptionObject *self); static PyObject * -BaseException___traceback___get(PyBaseExceptionObject *self, void *Py_UNUSED(context)) +BaseException___traceback___get(PyObject *self, void *Py_UNUSED(context)) { PyObject *return_value = NULL; Py_BEGIN_CRITICAL_SECTION(self); - return_value = BaseException___traceback___get_impl(self); + return_value = BaseException___traceback___get_impl((PyBaseExceptionObject *)self); Py_END_CRITICAL_SECTION(); return return_value; @@ -196,12 +196,12 @@ BaseException___traceback___set_impl(PyBaseExceptionObject *self, PyObject *value); 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; 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(); return return_value; @@ -221,12 +221,12 @@ static PyObject * BaseException___context___get_impl(PyBaseExceptionObject *self); static PyObject * -BaseException___context___get(PyBaseExceptionObject *self, void *Py_UNUSED(context)) +BaseException___context___get(PyObject *self, void *Py_UNUSED(context)) { PyObject *return_value = NULL; Py_BEGIN_CRITICAL_SECTION(self); - return_value = BaseException___context___get_impl(self); + return_value = BaseException___context___get_impl((PyBaseExceptionObject *)self); Py_END_CRITICAL_SECTION(); return return_value; @@ -247,12 +247,12 @@ BaseException___context___set_impl(PyBaseExceptionObject *self, PyObject *value); 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; 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(); return return_value; @@ -272,12 +272,12 @@ static PyObject * BaseException___cause___get_impl(PyBaseExceptionObject *self); static PyObject * -BaseException___cause___get(PyBaseExceptionObject *self, void *Py_UNUSED(context)) +BaseException___cause___get(PyObject *self, void *Py_UNUSED(context)) { PyObject *return_value = NULL; Py_BEGIN_CRITICAL_SECTION(self); - return_value = BaseException___cause___get_impl(self); + return_value = BaseException___cause___get_impl((PyBaseExceptionObject *)self); Py_END_CRITICAL_SECTION(); return return_value; @@ -298,14 +298,14 @@ BaseException___cause___set_impl(PyBaseExceptionObject *self, PyObject *value); 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; 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(); return return_value; } -/*[clinic end generated code: output=58afcfd60057fc39 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8be99f8a7e527ba4 input=a9049054013a1b77]*/ diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 4df89edfaf3953..d23b7f7c76c3e7 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -4256,7 +4256,7 @@ _PyException_AddNote(PyObject *exc, PyObject *note) Py_TYPE(exc)->tp_name); return -1; } - PyObject *r = BaseException_add_note(_PyBaseExceptionObject_cast(exc), note); + PyObject *r = BaseException_add_note(exc, note); int res = r == NULL ? -1 : 0; Py_XDECREF(r); return res;