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 3333import com .oracle .graal .python .builtins .objects .PNone ;
3434import com .oracle .graal .python .builtins .objects .PythonAbstractObject ;
3535import 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 ;
3738import com .oracle .graal .python .nodes .attributes .WriteAttributeToDynamicObjectNode ;
3839import com .oracle .truffle .api .Assumption ;
3940import com .oracle .truffle .api .CompilerAsserts ;
@@ -174,7 +175,15 @@ public int compareTo(Object o) {
174175 */
175176 @ Override
176177 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 ()) + ">" ;
178187 }
179188
180189 @ ExportMessage
You can’t perform that action at this time.
0 commit comments