Skip to content

Commit 4807420

Browse files
committed
REPR is not a builtin method
1 parent 23f6c9f commit 4807420

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/PythonLanguage.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,11 @@ protected Iterable<Scope> findTopScopes(PythonContext context) {
387387
@Override
388388
protected String toString(PythonContext context, Object value) {
389389
final PythonModule builtins = context.getBuiltins();
390-
PBuiltinFunction intClass = ((PBuiltinMethod) builtins.getAttribute(BuiltinNames.REPR)).getFunction();
391-
Object[] userArgs = PArguments.create(1);
392-
PArguments.setArgument(userArgs, 0, value);
393-
Object res = InvokeNode.create(intClass).invoke(userArgs);
390+
PBuiltinFunction reprMethod = ((PBuiltinMethod) builtins.getAttribute(BuiltinNames.REPR)).getFunction();
391+
Object[] userArgs = PArguments.create(2);
392+
PArguments.setArgument(userArgs, 0, PNone.NONE);
393+
PArguments.setArgument(userArgs, 1, value);
394+
Object res = InvokeNode.create(reprMethod).invoke(userArgs);
394395
return res.toString();
395396
}
396397

0 commit comments

Comments
 (0)