File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/object Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 33
33
import com .oracle .graal .python .builtins .objects .PNone ;
34
34
import com .oracle .graal .python .builtins .objects .PythonAbstractObject ;
35
35
import com .oracle .graal .python .builtins .objects .common .PHashingCollection ;
36
- import com .oracle .graal .python .builtins .objects .type .TypeNodes ;
36
+ import com .oracle .graal .python .builtins .objects .type .PythonManagedClass ;
37
+ import com .oracle .graal .python .nodes .PGuards ;
37
38
import com .oracle .graal .python .nodes .attributes .WriteAttributeToDynamicObjectNode ;
38
39
import com .oracle .truffle .api .Assumption ;
39
40
import com .oracle .truffle .api .CompilerAsserts ;
@@ -174,7 +175,15 @@ public int compareTo(Object o) {
174
175
*/
175
176
@ Override
176
177
public String toString () {
177
- return "<" + TypeNodes .GetNameNode .doSlowPath (PythonObjectLibrary .getUncached ().getLazyPythonClass (this )) + " object at 0x" + Integer .toHexString (hashCode ()) + ">" ;
178
+ String className = "unknown" ;
179
+ if (storedPythonClass instanceof PythonManagedClass ) {
180
+ className = ((PythonManagedClass ) storedPythonClass ).getName ();
181
+ } else if (storedPythonClass instanceof PythonBuiltinClassType ) {
182
+ className = ((PythonBuiltinClassType ) storedPythonClass ).getName ();
183
+ } else if (PGuards .isNativeClass (storedPythonClass )) {
184
+ className = "native" ;
185
+ }
186
+ return "<" + className + " object at 0x" + Integer .toHexString (hashCode ()) + ">" ;
178
187
}
179
188
180
189
@ ExportMessage
You can’t perform that action at this time.
0 commit comments