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/sha512module.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/sha512module.c.h')
-rw-r--r-- | Modules/clinic/sha512module.c.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/Modules/clinic/sha512module.c.h b/Modules/clinic/sha512module.c.h index b8185b6..f1192d7 100644 --- a/Modules/clinic/sha512module.c.h +++ b/Modules/clinic/sha512module.c.h @@ -9,15 +9,26 @@ PyDoc_STRVAR(SHA512Type_copy__doc__, "Return a copy of the hash object."); #define SHA512TYPE_COPY_METHODDEF \ - {"copy", (PyCFunction)SHA512Type_copy, METH_NOARGS, SHA512Type_copy__doc__}, + {"copy", (PyCFunction)(void(*)(void))SHA512Type_copy, METH_METHOD|METH_FASTCALL|METH_KEYWORDS, SHA512Type_copy__doc__}, static PyObject * -SHA512Type_copy_impl(SHAobject *self); +SHA512Type_copy_impl(SHAobject *self, PyTypeObject *cls); static PyObject * -SHA512Type_copy(SHAobject *self, PyObject *Py_UNUSED(ignored)) +SHA512Type_copy(SHAobject *self, PyTypeObject *cls, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { - return SHA512Type_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 = SHA512Type_copy_impl(self, cls); + +exit: + return return_value; } PyDoc_STRVAR(SHA512Type_digest__doc__, @@ -166,4 +177,4 @@ skip_optional_kwonly: exit: return return_value; } -/*[clinic end generated code: output=bbfa72d8703c82b5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9ff9f11937fabf35 input=a9049054013a1b77]*/ |