unix/modjni: py2jvalue: Handle both int and long java types (with TODO for long).

This commit is contained in:
Paul Sokolovsky 2015-09-18 13:19:50 +03:00
parent 1cb5de2cd5
commit 011c7f5718
1 changed files with 6 additions and 2 deletions

View File

@ -218,8 +218,12 @@ STATIC bool py2jvalue(const char **jtypesig, mp_obj_t arg, jvalue *out) {
return false;
}
} else if (type == &mp_type_int) {
CHECK_TYPE("long");
out->j = mp_obj_get_int(arg);
if (IMATCH(arg_type, "int") || IMATCH(arg_type, "long")) {
// TODO: Java long is 64-bit actually
out->j = mp_obj_get_int(arg);
} else {
return false;
}
} else {
nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, "arg type not supported"));
}