diff options
author | Victor Stinner <vstinner@python.org> | 2023-10-17 11:46:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-17 11:46:16 (GMT) |
commit | 054f496bd45cf94eac4158fd60ac95ab5f8e45c4 (patch) | |
tree | cd805377e846048398ff86cec510573c23a76d18 /Tools | |
parent | 4dba0a6d871c24bef8570e4f35669a0db89c2e3b (diff) | |
download | cpython-054f496bd45cf94eac4158fd60ac95ab5f8e45c4.zip cpython-054f496bd45cf94eac4158fd60ac95ab5f8e45c4.tar.gz cpython-054f496bd45cf94eac4158fd60ac95ab5f8e45c4.tar.bz2 |
gh-85283: Fix Argument Clinic for md5 extension (#110976)
Limited C API supports the defining class under some conditions.
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/clinic/clinic.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index a549865..3112e7c 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -1199,7 +1199,7 @@ class CLanguage(Language): fastcall = not new_or_init 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_keyword_only() and not p.is_optional() for p in parameters)) or any(c.broken_limited_capi for c in converters)): @@ -1642,12 +1642,11 @@ class CLanguage(Language): declarations=declarations) + methoddef_cast_end = "" if flags in ('METH_NOARGS', 'METH_O', 'METH_VARARGS'): methoddef_cast = "(PyCFunction)" - methoddef_cast_end = "" elif limited_capi: methoddef_cast = "(PyCFunction)(void(*)(void))" - methoddef_cast_end = "" else: methoddef_cast = "_PyCFunction_CAST(" methoddef_cast_end = ")" |