summaryrefslogtreecommitdiffstatshomepage
path: root/lib/netutils
diff options
context:
space:
mode:
Diffstat (limited to 'lib/netutils')
-rw-r--r--lib/netutils/netutils.c5
-rw-r--r--lib/netutils/netutils.h8
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/netutils/netutils.c b/lib/netutils/netutils.c
index a2ea31cf38..15e70397cb 100644
--- a/lib/netutils/netutils.c
+++ b/lib/netutils/netutils.c
@@ -1,5 +1,5 @@
/*
- * This file is part of the Micro Python project, http://micropython.org/
+ * This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
@@ -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");
}
}
}
diff --git a/lib/netutils/netutils.h b/lib/netutils/netutils.h
index 45e0216402..4befc90db0 100644
--- a/lib/netutils/netutils.h
+++ b/lib/netutils/netutils.h
@@ -1,5 +1,5 @@
/*
- * This file is part of the Micro Python project, http://micropython.org/
+ * This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
@@ -24,8 +24,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-#ifndef __MICROPY_INCLUDED_LIB_NETUTILS_H__
-#define __MICROPY_INCLUDED_LIB_NETUTILS_H__
+#ifndef MICROPY_INCLUDED_LIB_NETUTILS_NETUTILS_H
+#define MICROPY_INCLUDED_LIB_NETUTILS_NETUTILS_H
#define NETUTILS_IPV4ADDR_BUFSIZE 4
@@ -47,4 +47,4 @@ void netutils_parse_ipv4_addr(mp_obj_t addr_in, uint8_t *out_ip, netutils_endian
// puts IP in out_ip (which must take at least IPADDR_BUF_SIZE bytes).
mp_uint_t netutils_parse_inet_addr(mp_obj_t addr_in, uint8_t *out_ip, netutils_endian_t endian);
-#endif // __MICROPY_INCLUDED_LIB_NETUTILS_H__
+#endif // MICROPY_INCLUDED_LIB_NETUTILS_NETUTILS_H