Skip to content

Commit fc52372

Browse files
committed
workaround to make numpy help work again
1 parent ddebec7 commit fc52372

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/function/WrapperDescriptorBuiltins.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@ abstract static class ReprNode extends PythonUnaryBuiltinNode {
104104
@Specialization
105105
static TruffleString reprClassFunction(PBuiltinFunction self,
106106
@Cached StringUtils.SimpleTruffleStringFormatNode simpleTruffleStringFormatNode) {
107-
return simpleTruffleStringFormatNode.format("<slot wrapper '%s' of '%s' objects>", self.getName(), TypeNodes.GetNameNode.doSlowPath(self.getEnclosingType()));
107+
if (self.getEnclosingType() == null) {
108+
// XXX: this is wrong
109+
return simpleTruffleStringFormatNode.format("<builtin_function_or_method '%s'>", self.getName());
110+
} else {
111+
return simpleTruffleStringFormatNode.format("<slot wrapper '%s' of '%s' objects>", self.getName(), TypeNodes.GetNameNode.doSlowPath(self.getEnclosingType()));
112+
}
108113
}
109114
}
110115
}

0 commit comments

Comments
 (0)