summaryrefslogtreecommitdiffstats
path: root/Modules/clinic
diff options
context:
space:
mode:
authorKumar Aditya <59607654+kumaraditya303@users.noreply.github.com>2022-09-25 13:32:48 (GMT)
committerGitHub <noreply@github.com>2022-09-25 13:32:48 (GMT)
commitc8c0afc7137ab9f22bf59d591084948ca967c97c (patch)
tree60cfb58ebb2efefdc00cd339a4f9b545e35bccea /Modules/clinic
parentf5f047aa628caeca680745c55e24519f06aa6724 (diff)
downloadcpython-c8c0afc7137ab9f22bf59d591084948ca967c97c.zip
cpython-c8c0afc7137ab9f22bf59d591084948ca967c97c.tar.gz
cpython-c8c0afc7137ab9f22bf59d591084948ca967c97c.tar.bz2
GH-78724: Initialize struct.Struct in __new__ (GH-94532)
Closes https://github.com/python/cpython/issues/75960 Closes https://github.com/python/cpython/issues/78724
Diffstat (limited to 'Modules/clinic')
-rw-r--r--Modules/clinic/_struct.c.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/Modules/clinic/_struct.c.h b/Modules/clinic/_struct.c.h
index b21d9ff..c3cf179 100644
--- a/Modules/clinic/_struct.c.h
+++ b/Modules/clinic/_struct.c.h
@@ -8,7 +8,7 @@ preserve
#endif
-PyDoc_STRVAR(Struct___init____doc__,
+PyDoc_STRVAR(Struct__doc__,
"Struct(format)\n"
"--\n"
"\n"
@@ -19,13 +19,13 @@ PyDoc_STRVAR(Struct___init____doc__,
"\n"
"See help(struct) for more on format strings.");
-static int
-Struct___init___impl(PyStructObject *self, PyObject *format);
+static PyObject *
+Struct_impl(PyTypeObject *type, PyObject *format);
-static int
-Struct___init__(PyObject *self, PyObject *args, PyObject *kwargs)
+static PyObject *
+Struct(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
- int return_value = -1;
+ PyObject *return_value = NULL;
#if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
#define NUM_KEYWORDS 1
@@ -61,7 +61,7 @@ Struct___init__(PyObject *self, PyObject *args, PyObject *kwargs)
goto exit;
}
format = fastargs[0];
- return_value = Struct___init___impl((PyStructObject *)self, format);
+ return_value = Struct_impl(type, format);
exit:
return return_value;
@@ -451,4 +451,4 @@ exit:
return return_value;
}
-/*[clinic end generated code: output=eca7df0e75f8919d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f3d6e06f80368998 input=a9049054013a1b77]*/