fix const vs static generatorexit again
This commit is contained in:
parent
e1fffe67a0
commit
6b5c7b6ce6
2
py/obj.h
2
py/obj.h
|
@ -926,7 +926,9 @@ extern const struct _mp_obj_dict_t mp_const_empty_dict_obj;
|
|||
extern const struct _mp_obj_singleton_t mp_const_ellipsis_obj;
|
||||
extern const struct _mp_obj_traceback_t mp_const_empty_traceback_obj;
|
||||
extern const struct _mp_obj_singleton_t mp_const_notimplemented_obj;
|
||||
#if MICROPY_CONST_GENERATOREXIT_OBJ
|
||||
extern const struct _mp_obj_exception_t mp_const_GeneratorExit_obj;
|
||||
#endif
|
||||
|
||||
// Fixed empty map. Useful when calling keyword-receiving functions
|
||||
// without any keywords from C, etc.
|
||||
|
|
|
@ -285,7 +285,7 @@ void mp_obj_exception_attr(mp_obj_t self_in, qstr attr, mp_obj_t *dest) {
|
|||
if (dest[0] != MP_OBJ_NULL) {
|
||||
// store/delete attribute
|
||||
#if MICROPY_CONST_GENERATOREXIT_OBJ
|
||||
if (self == &mp_static_GeneratorExit_obj) {
|
||||
if (self == &mp_const_GeneratorExit_obj) {
|
||||
mp_raise_AttributeError(MP_ERROR_TEXT("can't set attribute"));
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
// CIRCUITPY: https://github.com/adafruit/circuitpython/pull/7069 fix
|
||||
#if MICROPY_CONST_GENERATOREXIT_OBJ
|
||||
const
|
||||
mp_obj_exception_t mp_static_GeneratorExit_obj = {{&mp_type_GeneratorExit}, (mp_obj_tuple_t *)&mp_const_empty_tuple_obj, (mp_obj_traceback_t *)&mp_const_empty_traceback_obj};
|
||||
mp_obj_exception_t mp_const_GeneratorExit_obj = {{&mp_type_GeneratorExit}, (mp_obj_tuple_t *)&mp_const_empty_tuple_obj, (mp_obj_traceback_t *)&mp_const_empty_traceback_obj};
|
||||
#else
|
||||
static
|
||||
mp_obj_exception_t mp_static_GeneratorExit_obj;
|
||||
|
@ -397,7 +397,7 @@ static mp_obj_t generatorexit(void) {
|
|||
MP_STATIC_ASSERT(!MICROPY_CONST_GENERATOREXIT_OBJ);
|
||||
mp_obj_exception_initialize0(&mp_static_GeneratorExit_obj, &mp_type_GeneratorExit);
|
||||
#endif
|
||||
return MP_OBJ_FROM_PTR(&mp_static_GeneratorExit_obj);
|
||||
return MP_OBJ_FROM_PTR(&mp_const_GeneratorExit_obj);
|
||||
}
|
||||
|
||||
STATIC mp_obj_t gen_instance_close(mp_obj_t self_in) {
|
||||
|
|
Loading…
Reference in New Issue