Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 054f496

Browse files
authored
gh-85283: Fix Argument Clinic for md5 extension (#110976)
Limited C API supports the defining class under some conditions.
1 parent 4dba0a6 commit 054f496

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Modules/clinic/md5module.c.h

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tools/clinic/clinic.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ def parser_body(
11991199

12001200
fastcall = not new_or_init
12011201
limited_capi = clinic.limited_capi
1202-
if limited_capi and (requires_defining_class or pseudo_args or
1202+
if limited_capi and (pseudo_args or
12031203
(any(p.is_optional() for p in parameters) and
12041204
any(p.is_keyword_only() and not p.is_optional() for p in parameters)) or
12051205
any(c.broken_limited_capi for c in converters)):
@@ -1642,12 +1642,11 @@ def parser_body(
16421642
declarations=declarations)
16431643

16441644

1645+
methoddef_cast_end = ""
16451646
if flags in ('METH_NOARGS', 'METH_O', 'METH_VARARGS'):
16461647
methoddef_cast = "(PyCFunction)"
1647-
methoddef_cast_end = ""
16481648
elif limited_capi:
16491649
methoddef_cast = "(PyCFunction)(void(*)(void))"
1650-
methoddef_cast_end = ""
16511650
else:
16521651
methoddef_cast = "_PyCFunction_CAST("
16531652
methoddef_cast_end = ")"

0 commit comments

Comments
 (0)