From 92917b84f1a173a06d337d82a7a5568f680ff268 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sat, 1 Aug 2020 16:03:00 -0500 Subject: [PATCH] fix exception type for pop from empty set --- py/objset.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/objset.c b/py/objset.c index 82b10e7e89..6764a5c6f6 100644 --- a/py/objset.c +++ b/py/objset.c @@ -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; }