py: Fix regress with GeneratorExit object becoming truly const.
This commit is contained in:
parent
918638ec6e
commit
b04be056fe
3
py/vm.c
3
py/vm.c
|
@ -735,7 +735,8 @@ yield:
|
|||
// set file and line number that the exception occurred at
|
||||
// TODO: don't set traceback for exceptions re-raised by END_FINALLY.
|
||||
// But consider how to handle nested exceptions.
|
||||
if (mp_obj_is_exception_instance(nlr.ret_val)) {
|
||||
// TODO need a better way of not adding traceback to constant objects (right now, just GeneratorExit_obj)
|
||||
if (mp_obj_is_exception_instance(nlr.ret_val) && nlr.ret_val != &mp_const_GeneratorExit_obj) {
|
||||
machine_uint_t code_info_size = code_info[0] | (code_info[1] << 8) | (code_info[2] << 16) | (code_info[3] << 24);
|
||||
qstr source_file = code_info[4] | (code_info[5] << 8) | (code_info[6] << 16) | (code_info[7] << 24);
|
||||
qstr block_name = code_info[8] | (code_info[9] << 8) | (code_info[10] << 16) | (code_info[11] << 24);
|
||||
|
|
Loading…
Reference in New Issue