fix exception type for pop from empty set

This commit is contained in:
Jeff Epler 2020-08-01 16:03:00 -05:00
parent 67eb93fc98
commit 92917b84f1

View File

@ -368,7 +368,7 @@ STATIC mp_obj_t set_pop(mp_obj_t self_in) {
mp_obj_set_t *self = MP_OBJ_TO_PTR(self_in);
mp_obj_t obj = mp_set_remove_first(&self->set);
if (obj == MP_OBJ_NULL) {
mp_raise_IndexError_varg(translate("pop from empty %s"), "set");
mp_raise_msg_varg(&mp_type_KeyError, translate("pop from empty %s"), "set");
}
return obj;
}