Skip to content

Commit 23f6c9f

Browse files
committed
set name and doc on the function, not the method
1 parent 935e989 commit 23f6c9f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

graalpython/lib-graalpython/python_cext.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -732,11 +732,12 @@ def __init__(self, *args, **kwargs):
732732

733733

734734
def PyCFunction_NewEx(name, cfunc, cwrapper, wrapper, self, module, doc):
735-
func = wrapper(CreateBuiltinMethod(CreateFunction(name, cfunc, cwrapper), self))
736-
func.__module__ = module.__name__
735+
func = wrapper(CreateFunction(name, cfunc, cwrapper))
737736
func.__name__ = name
738737
func.__doc__ = doc
739-
return func
738+
method = methodtype(self, func)
739+
method.__module__ = module.__name__
740+
return method
740741

741742

742743
def AddMember(primary, name, memberType, offset, canSet, doc):

0 commit comments

Comments
 (0)