Skip to content

Commit f9b2995

Browse files
committed
fix faulty format string in MethodBuiltins
1 parent ce3e992 commit f9b2995

File tree

1 file changed

+4
-2
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/method

1 file changed

+4
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/method/MethodBuiltins.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import com.oracle.graal.python.nodes.function.PythonBuiltinBaseNode;
4747
import com.oracle.graal.python.nodes.function.PythonBuiltinNode;
4848
import com.oracle.graal.python.nodes.function.builtins.PythonUnaryBuiltinNode;
49+
import com.oracle.graal.python.nodes.object.GetLazyClassNode;
4950
import com.oracle.graal.python.nodes.truffle.PythonArithmeticTypes;
5051
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
5152
import com.oracle.truffle.api.dsl.Cached;
@@ -92,8 +93,9 @@ protected Object doIt(PMethod self,
9293
public abstract static class ReprNode extends PythonUnaryBuiltinNode {
9394
@Specialization
9495
@TruffleBoundary
95-
Object reprMethod(PMethod self) {
96-
return String.format("<built-in method %s of %p object at 0x%x>", self.getName(), self.getSelf(), self.hashCode());
96+
Object reprMethod(PMethod self,
97+
@Cached("create()") GetLazyClassNode getClassNode) {
98+
return String.format("<built-in method %s of %s object at 0x%x>", self.getName(), getClassNode.execute(self.getSelf()).getName(), self.hashCode());
9799
}
98100
}
99101

0 commit comments

Comments
 (0)