File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
com.oracle.graal.python.test/src/com/oracle/graal/python/test/interop
com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,10 @@ public void testException() {
174
174
context .eval ("python" , "1/0" );
175
175
} catch (PolyglotException e ) {
176
176
Value exception = e .getGuestObject ();
177
+ assertTrue (exception .isException ());
178
+ Value clazz = exception .getMetaObject ();
179
+ assertTrue (clazz .isMetaObject ());
180
+ assertEquals ("ZeroDivisionError" , clazz .getMetaSimpleName ());
177
181
assertTrue (exception .hasMember ("args" ));
178
182
Value args = exception .getMember ("args" );
179
183
assertTrue (args .hasArrayElements ());
Original file line number Diff line number Diff line change 33
33
import com .oracle .graal .python .builtins .objects .object .PythonObjectLibrary ;
34
34
import com .oracle .graal .python .nodes .ErrorMessages ;
35
35
import com .oracle .graal .python .nodes .classes .IsSubtypeNode ;
36
+ import com .oracle .graal .python .nodes .interop .PForeignToPTypeNode ;
36
37
import com .oracle .truffle .api .CompilerAsserts ;
37
38
import com .oracle .truffle .api .CompilerDirectives .TruffleBoundary ;
38
39
import com .oracle .truffle .api .dsl .Cached ;
@@ -87,8 +88,9 @@ boolean isMetaObject() {
87
88
@ SuppressWarnings ("static-method" )
88
89
boolean isMetaInstance (Object instance ,
89
90
@ CachedLibrary (limit = "3" ) PythonObjectLibrary plib ,
91
+ @ Cached PForeignToPTypeNode convert ,
90
92
@ Cached IsSubtypeNode isSubtype ) {
91
- return isSubtype .execute (plib .getLazyPythonClass (instance ), this );
93
+ return isSubtype .execute (plib .getLazyPythonClass (convert . executeConvert ( instance ) ), this );
92
94
}
93
95
94
96
@ ExportMessage
You can’t perform that action at this time.
0 commit comments