From 7d0d7215d2575a2d36d34c9a13b58cade0610a28 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 17 Oct 2016 12:17:37 +1100 Subject: py: Use mp_raise_msg helper function where appropriate. Saves the following number of bytes of code space: 176 for bare-arm, 352 for minimal, 272 for unix x86-64, 140 for stmhal, 120 for esp8266. --- py/objobject.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'py/objobject.c') diff --git a/py/objobject.c b/py/objobject.c index bba6f053e6..b33dc491c4 100644 --- a/py/objobject.c +++ b/py/objobject.c @@ -50,8 +50,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(object___init___obj, object___init__); STATIC mp_obj_t object___new__(mp_obj_t cls) { if (!MP_OBJ_IS_TYPE(cls, &mp_type_type) || !mp_obj_is_instance_type((mp_obj_type_t*)MP_OBJ_TO_PTR(cls))) { - nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, - "__new__ arg must be a user-type")); + mp_raise_msg(&mp_type_TypeError, "__new__ arg must be a user-type"); } mp_obj_t o = MP_OBJ_SENTINEL; mp_obj_t res = mp_obj_instance_make_new(MP_OBJ_TO_PTR(cls), 1, 0, &o); -- cgit v1.2.3