summaryrefslogtreecommitdiffstats
path: root/Modules/clinic
diff options
context:
space:
mode:
authorMohamed Koubaa <koubaa.m@gmail.com>2020-09-08 09:16:14 (GMT)
committerGitHub <noreply@github.com>2020-09-08 09:16:14 (GMT)
commit52a2df135c0470b1dbf889edc51b7c556ae4bc80 (patch)
tree037be8322d853f2cf882d2212b28dc722c738e3f /Modules/clinic
parent15dcdb211366e0788e831fc2a1f785e6a5ca2749 (diff)
downloadcpython-52a2df135c0470b1dbf889edc51b7c556ae4bc80.zip
cpython-52a2df135c0470b1dbf889edc51b7c556ae4bc80.tar.gz
cpython-52a2df135c0470b1dbf889edc51b7c556ae4bc80.tar.bz2
bpo-1635741: Convert _sha256 types to heap types (GH-22134)
Convert the _sha256 extension module types to heap types.
Diffstat (limited to 'Modules/clinic')
-rw-r--r--Modules/clinic/sha256module.c.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/Modules/clinic/sha256module.c.h b/Modules/clinic/sha256module.c.h
index 2a788ea..89205c4 100644
--- a/Modules/clinic/sha256module.c.h
+++ b/Modules/clinic/sha256module.c.h
@@ -9,15 +9,26 @@ PyDoc_STRVAR(SHA256Type_copy__doc__,
"Return a copy of the hash object.");
#define SHA256TYPE_COPY_METHODDEF \
- {"copy", (PyCFunction)SHA256Type_copy, METH_NOARGS, SHA256Type_copy__doc__},
+ {"copy", (PyCFunction)(void(*)(void))SHA256Type_copy, METH_METHOD|METH_FASTCALL|METH_KEYWORDS, SHA256Type_copy__doc__},
static PyObject *
-SHA256Type_copy_impl(SHAobject *self);
+SHA256Type_copy_impl(SHAobject *self, PyTypeObject *cls);
static PyObject *
-SHA256Type_copy(SHAobject *self, PyObject *Py_UNUSED(ignored))
+SHA256Type_copy(SHAobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
{
- return SHA256Type_copy_impl(self);
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = { NULL};
+ static _PyArg_Parser _parser = {":copy", _keywords, 0};
+
+ if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser
+ )) {
+ goto exit;
+ }
+ return_value = SHA256Type_copy_impl(self, cls);
+
+exit:
+ return return_value;
}
PyDoc_STRVAR(SHA256Type_digest__doc__,
@@ -166,4 +177,4 @@ skip_optional_kwonly:
exit:
return return_value;
}
-/*[clinic end generated code: output=c8cca8adbe72ec9a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b7283f75c9d08f30 input=a9049054013a1b77]*/