File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ static jmethodID List_get_mid;
5555static jmethodID List_set_mid ;
5656static jmethodID List_size_mid ;
5757
58+ static jclass IndexException_class ;
59+
5860STATIC const mp_obj_type_t jobject_type ;
5961STATIC const mp_obj_type_t jmethod_type ;
6062
@@ -98,6 +100,9 @@ STATIC void check_exception(void) {
98100 //JJ1(ExceptionDescribe);
99101 mp_obj_t py_e = new_jobject (exc );
100102 JJ1 (ExceptionClear );
103+ if (JJ (IsInstanceOf , exc , IndexException_class )) {
104+ nlr_raise (mp_obj_new_exception_arg1 (& mp_type_IndexError , py_e ));
105+ }
101106 nlr_raise (mp_obj_new_exception_arg1 (& mp_type_Exception , py_e ));
102107 }
103108}
@@ -513,6 +518,7 @@ STATIC void create_jvm() {
513518 "(ILjava/lang/Object;)Ljava/lang/Object;" );
514519 List_size_mid = JJ (GetMethodID , List_class , "size" ,
515520 "()I" );
521+ IndexException_class = JJ (FindClass , "java/lang/IndexOutOfBoundsException" );
516522}
517523
518524STATIC mp_obj_t mod_jni_cls (mp_obj_t cls_name_in ) {
You can’t perform that action at this time.
0 commit comments