diff --git a/jnius/jnius_conversion.pxi b/jnius/jnius_conversion.pxi index 8a2aba0..f155c6e 100644 --- a/jnius/jnius_conversion.pxi +++ b/jnius/jnius_conversion.pxi @@ -485,6 +485,7 @@ cdef jstring convert_pystr_to_java(JNIEnv *j_env, basestring py_str) except NULL cdef jobject convert_pyarray_to_java(JNIEnv *j_env, definition, pyarray) except *: cdef jobject ret = NULL + cdef jobject nested = NULL cdef int array_size = len(pyarray) cdef int i cdef unsigned char c_tmp @@ -622,6 +623,17 @@ cdef jobject convert_pyarray_to_java(JNIEnv *j_env, definition, pyarray) except ) j_env[0].DeleteLocalRef(j_env, j_string) + # isinstance(arg, type) will return False + # ...and it's really weird + elif isinstance(arg, (tuple, list)): + nested = convert_pyarray_to_java( + j_env, definition, arg + ) + j_env[0].SetObjectArrayElement( + j_env, ret, i, nested + ) + j_env[0].DeleteLocalRef(j_env, nested) + # no local refs to delete for class, type and object elif isinstance(arg, JavaClass): jc = arg