Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
c4489a05
Commit
c4489a05
authored
Oct 01, 2015
by
Paul Sokolovsky
Browse files
unix/modjni: Propagate Java exceptions on list access.
parent
0eba162a
Changes
1
Hide whitespace changes
Inline
Side-by-side
unix/modjni.c
View file @
c4489a05
...
...
@@ -92,6 +92,16 @@ STATIC bool is_object_type(const char *jtypesig) {
return
false
;
}
STATIC
void
check_exception
(
void
)
{
jobject
exc
=
JJ1
(
ExceptionOccurred
);
if
(
exc
)
{
//JJ1(ExceptionDescribe);
mp_obj_t
py_e
=
new_jobject
(
exc
);
JJ1
(
ExceptionClear
);
nlr_raise
(
mp_obj_new_exception_arg1
(
&
mp_type_Exception
,
py_e
));
}
}
// jclass
STATIC
void
jclass_print
(
const
mp_print_t
*
print
,
mp_obj_t
self_in
,
mp_print_kind_t
kind
)
{
...
...
@@ -200,6 +210,9 @@ STATIC mp_obj_t jobject_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value)
}
else
if
(
value
==
MP_OBJ_SENTINEL
)
{
// load
jobject
el
=
JJ
(
CallObjectMethod
,
self
->
obj
,
List_get_mid
,
idx
);
if
(
el
==
NULL
)
{
check_exception
();
}
return
new_jobject
(
el
);
}
else
{
// store
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment