Skip to content

Commit 011c7f5

Browse files
committed
unix/modjni: py2jvalue: Handle both int and long java types (with TODO for long).
1 parent 1cb5de2 commit 011c7f5

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

unix/modjni.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,12 @@ STATIC bool py2jvalue(const char **jtypesig, mp_obj_t arg, jvalue *out) {
218218
return false;
219219
}
220220
} else if (type == &mp_type_int) {
221-
CHECK_TYPE("long");
222-
out->j = mp_obj_get_int(arg);
221+
if (IMATCH(arg_type, "int") || IMATCH(arg_type, "long")) {
222+
// TODO: Java long is 64-bit actually
223+
out->j = mp_obj_get_int(arg);
224+
} else {
225+
return false;
226+
}
223227
} else {
224228
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, "arg type not supported"));
225229
}

0 commit comments

Comments
 (0)