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
548e76cf
Commit
548e76cf
authored
Mar 26, 2014
by
Damien George
Browse files
py: Use _is_subclass_fast instead of _exception_match.
parent
752ba554
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/objgenerator.c
View file @
548e76cf
...
...
@@ -174,8 +174,9 @@ STATIC mp_obj_t gen_instance_close(mp_obj_t self_in) {
}
// Swallow StopIteration & GeneratorExit (== successful close), and re-raise any other
if
(
ret_kind
==
MP_VM_RETURN_EXCEPTION
)
{
if
(
mp_obj_exception_match
(
ret
,
&
mp_type_GeneratorExit
)
||
mp_obj_exception_match
(
ret
,
&
mp_type_StopIteration
))
{
// ret should always be an instance of an exception class
if
(
mp_obj_is_subclass_fast
(
mp_obj_get_type
(
ret
),
&
mp_type_GeneratorExit
)
||
mp_obj_is_subclass_fast
(
mp_obj_get_type
(
ret
),
&
mp_type_StopIteration
))
{
return
mp_const_none
;
}
nlr_jump
(
ret
);
...
...
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