Skip to content

Commit 074b2ae

Browse files
committed
do not add a PyCFunction cast for METH_NOARGS, METH_O and METH_VARARGS
1 parent af29d5c commit 074b2ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tools/clinic/libclinic/parse_args.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,9 +831,9 @@ def handle_new_or_init(self) -> None:
831831
def process_methoddef(self, clang: CLanguage) -> None:
832832
methoddef_cast_end = ""
833833
if self.flags in ('METH_NOARGS', 'METH_O', 'METH_VARARGS'):
834-
methoddef_cast = "(PyCFunction)"
834+
methoddef_cast = "" # no need for a PyCFunction cast
835835
elif self.func.kind is GETTER:
836-
methoddef_cast = "" # This should end up unused
836+
methoddef_cast = "" # this should end up unused
837837
elif self.limited_capi:
838838
methoddef_cast = "(PyCFunction)(void(*)(void))"
839839
else:

0 commit comments

Comments
 (0)