mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
gh-85283: Fix Argument Clinic for md5 extension (#110976)
Limited C API supports the defining class under some conditions.
This commit is contained in:
parent
4dba0a6d87
commit
054f496bd4
2 changed files with 4 additions and 5 deletions
4
Modules/clinic/md5module.c.h
generated
4
Modules/clinic/md5module.c.h
generated
|
@ -9,7 +9,7 @@ PyDoc_STRVAR(MD5Type_copy__doc__,
|
||||||
"Return a copy of the hash object.");
|
"Return a copy of the hash object.");
|
||||||
|
|
||||||
#define MD5TYPE_COPY_METHODDEF \
|
#define MD5TYPE_COPY_METHODDEF \
|
||||||
{"copy", _PyCFunction_CAST(MD5Type_copy), METH_METHOD|METH_FASTCALL|METH_KEYWORDS, MD5Type_copy__doc__},
|
{"copy", (PyCFunction)(void(*)(void))MD5Type_copy, METH_METHOD|METH_FASTCALL|METH_KEYWORDS, MD5Type_copy__doc__},
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
MD5Type_copy_impl(MD5object *self, PyTypeObject *cls);
|
MD5Type_copy_impl(MD5object *self, PyTypeObject *cls);
|
||||||
|
@ -97,4 +97,4 @@ _md5_md5(PyObject *module, PyObject *args, PyObject *kwargs)
|
||||||
exit:
|
exit:
|
||||||
return return_value;
|
return return_value;
|
||||||
}
|
}
|
||||||
/*[clinic end generated code: output=015f7613e3a9bb93 input=a9049054013a1b77]*/
|
/*[clinic end generated code: output=81702ec915f36236 input=a9049054013a1b77]*/
|
||||||
|
|
|
@ -1199,7 +1199,7 @@ class CLanguage(Language):
|
||||||
|
|
||||||
fastcall = not new_or_init
|
fastcall = not new_or_init
|
||||||
limited_capi = clinic.limited_capi
|
limited_capi = clinic.limited_capi
|
||||||
if limited_capi and (requires_defining_class or pseudo_args or
|
if limited_capi and (pseudo_args or
|
||||||
(any(p.is_optional() for p in parameters) and
|
(any(p.is_optional() for p in parameters) and
|
||||||
any(p.is_keyword_only() and not p.is_optional() for p in parameters)) or
|
any(p.is_keyword_only() and not p.is_optional() for p in parameters)) or
|
||||||
any(c.broken_limited_capi for c in converters)):
|
any(c.broken_limited_capi for c in converters)):
|
||||||
|
@ -1642,12 +1642,11 @@ class CLanguage(Language):
|
||||||
declarations=declarations)
|
declarations=declarations)
|
||||||
|
|
||||||
|
|
||||||
|
methoddef_cast_end = ""
|
||||||
if flags in ('METH_NOARGS', 'METH_O', 'METH_VARARGS'):
|
if flags in ('METH_NOARGS', 'METH_O', 'METH_VARARGS'):
|
||||||
methoddef_cast = "(PyCFunction)"
|
methoddef_cast = "(PyCFunction)"
|
||||||
methoddef_cast_end = ""
|
|
||||||
elif limited_capi:
|
elif limited_capi:
|
||||||
methoddef_cast = "(PyCFunction)(void(*)(void))"
|
methoddef_cast = "(PyCFunction)(void(*)(void))"
|
||||||
methoddef_cast_end = ""
|
|
||||||
else:
|
else:
|
||||||
methoddef_cast = "_PyCFunction_CAST("
|
methoddef_cast = "_PyCFunction_CAST("
|
||||||
methoddef_cast_end = ")"
|
methoddef_cast_end = ")"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue