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
1eac05d5
Commit
1eac05d5
authored
Mar 31, 2014
by
Paul Sokolovsky
Browse files
objgenerator: Another obscure case of propagating MP_OBJ_NULL optimization.
parent
1aa2c102
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/objgenerator.c
View file @
1eac05d5
...
...
@@ -127,7 +127,7 @@ STATIC mp_obj_t gen_resume_and_raise(mp_obj_t self_in, mp_obj_t send_value, mp_o
switch
(
mp_obj_gen_resume
(
self_in
,
send_value
,
throw_value
,
&
ret
))
{
case
MP_VM_RETURN_NORMAL
:
// Optimize return w/o value in case generator is used in for loop
if
(
ret
==
mp_const_none
)
{
if
(
ret
==
mp_const_none
||
ret
==
MP_OBJ_NULL
)
{
return
MP_OBJ_NULL
;
}
else
{
nlr_jump
(
mp_obj_new_exception_args
(
&
mp_type_StopIteration
,
1
,
&
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