We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 778b2c9 commit de8b572Copy full SHA for de8b572
graalpython/lib-graalpython/python_cext.py
@@ -704,7 +704,7 @@ def AddFunction(primary, name, cfunc, cwrapper, wrapper, doc, isclass=False, iss
704
owner = to_java(primary)
705
if isinstance(owner, moduletype):
706
# module case, we create the bound function-or-method
707
- func = PyCFunction_NewEx(name, cfunc, cwrapper, wrapper, owner, owner, doc)
+ func = PyCFunction_NewEx(name, cfunc, cwrapper, wrapper, owner, owner.__name__, doc)
708
object.__setattr__(owner, name, func)
709
else:
710
func = wrapper(CreateFunction(name, cfunc, cwrapper, owner))
@@ -728,7 +728,7 @@ def PyCFunction_NewEx(name, cfunc, cwrapper, wrapper, self, module, doc):
728
PyTruffle_SetAttr(func, "__name__", name)
729
PyTruffle_SetAttr(func, "__doc__", doc)
730
method = PyTruffle_BuiltinMethod(self, func)
731
- PyTruffle_SetAttr(method, "__module__", module.__name__)
+ PyTruffle_SetAttr(method, "__module__", to_java(module))
732
return method
733
734
0 commit comments