From 35a1fea90b2cae9d5cc8e9eab62ba4c67e8786db Mon Sep 17 00:00:00 2001 From: Javier Candeira Date: Wed, 9 Aug 2017 14:40:45 +1000 Subject: all: Raise exceptions via mp_raise_XXX - Changed: ValueError, TypeError, NotImplementedError - OSError invocations unchanged, because the corresponding utility function takes ints, not strings like the long form invocation. - OverflowError, IndexError and RuntimeError etc. not changed for now until we decide whether to add new utility functions. --- lib/netutils/netutils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/netutils/netutils.c') diff --git a/lib/netutils/netutils.c b/lib/netutils/netutils.c index a324521613..15e70397cb 100644 --- a/lib/netutils/netutils.c +++ b/lib/netutils/netutils.c @@ -31,6 +31,7 @@ #include "py/obj.h" #include "py/nlr.h" +#include "py/runtime.h" #include "lib/netutils/netutils.h" // Takes an array with a raw IPv4 address and returns something like '192.168.0.1'. @@ -80,7 +81,7 @@ void netutils_parse_ipv4_addr(mp_obj_t addr_in, uint8_t *out_ip, netutils_endian } else if (i > 0 && s < s_top && *s == '.') { s++; } else { - nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, "invalid arguments")); + mp_raise_ValueError("invalid arguments"); } } } -- cgit v1.2.3