]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111178: Regen clinic and fix exceptions.c post gh-128447 (#129060)
authorErlend E. Aasland <erlend@python.org>
Mon, 20 Jan 2025 12:46:30 +0000 (13:46 +0100)
committerGitHub <noreply@github.com>
Mon, 20 Jan 2025 12:46:30 +0000 (12:46 +0000)
Objects/clinic/exceptions.c.h
Objects/exceptions.c

index caa5b0c63e53c5f5122e35848be2e66475ebc8c9..3bd9a8553ab2fc43b35dcbbcaf8a7c804469cb98 100644 (file)
@@ -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]*/
index 4df89edfaf3953afab87d211457c8ded84efae91..d23b7f7c76c3e7a14d990e615d5d4b9c519bbec2 100644 (file)
@@ -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;