summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-10-17 11:46:16 (GMT)
committerGitHub <noreply@github.com>2023-10-17 11:46:16 (GMT)
commit054f496bd45cf94eac4158fd60ac95ab5f8e45c4 (patch)
treecd805377e846048398ff86cec510573c23a76d18 /Tools
parent4dba0a6d871c24bef8570e4f35669a0db89c2e3b (diff)
downloadcpython-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-xTools/clinic/clinic.py5
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 = ")"