diff options
author | Mohamed Koubaa <koubaa.m@gmail.com> | 2020-09-06 10:09:51 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-06 10:09:51 (GMT) |
commit | 63f102fe079ecb5cb7b921a1cf8bce4077a9d7e2 (patch) | |
tree | 55496c20a4e8da0303a51474ff3b559108683e9f /Modules/clinic/md5module.c.h | |
parent | 5371a464ce88ffc88f3bb95cfd86f355b7d02953 (diff) | |
download | cpython-63f102fe079ecb5cb7b921a1cf8bce4077a9d7e2.zip cpython-63f102fe079ecb5cb7b921a1cf8bce4077a9d7e2.tar.gz cpython-63f102fe079ecb5cb7b921a1cf8bce4077a9d7e2.tar.bz2 |
bpo-1635741: Port _sha1, _sha512, _md5 to multiphase init (GH-21818)
Port the _sha1, _sha512, and _md5 extension modules
to multi-phase initialization API (PEP 489).
Diffstat (limited to 'Modules/clinic/md5module.c.h')
-rw-r--r-- | Modules/clinic/md5module.c.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/Modules/clinic/md5module.c.h b/Modules/clinic/md5module.c.h index c109f9e..4762f28 100644 --- a/Modules/clinic/md5module.c.h +++ b/Modules/clinic/md5module.c.h @@ -9,15 +9,26 @@ PyDoc_STRVAR(MD5Type_copy__doc__, "Return a copy of the hash object."); #define MD5TYPE_COPY_METHODDEF \ - {"copy", (PyCFunction)MD5Type_copy, METH_NOARGS, MD5Type_copy__doc__}, + {"copy", (PyCFunction)(void(*)(void))MD5Type_copy, METH_METHOD|METH_FASTCALL|METH_KEYWORDS, MD5Type_copy__doc__}, static PyObject * -MD5Type_copy_impl(MD5object *self); +MD5Type_copy_impl(MD5object *self, PyTypeObject *cls); static PyObject * -MD5Type_copy(MD5object *self, PyObject *Py_UNUSED(ignored)) +MD5Type_copy(MD5object *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - return MD5Type_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 = MD5Type_copy_impl(self, cls); + +exit: + return return_value; } PyDoc_STRVAR(MD5Type_digest__doc__, @@ -115,4 +126,4 @@ skip_optional_kwonly: exit: return return_value; } -/*[clinic end generated code: output=dbe3abc60086f3ef input=a9049054013a1b77]*/ +/*[clinic end generated code: output=53ff7f22dbaaea36 input=a9049054013a1b77]*/ |