summaryrefslogtreecommitdiffstatshomepage
path: root/unix/modsocket.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-07-12 11:43:35 +1000
committerDamien George <damien.p.george@gmail.com>2017-07-12 11:43:35 +1000
commitd0db93cf1ff8eb8b2db63da07dd14d86577eebd1 (patch)
tree0629941fbb40ec4e6d29fb9631242fb0c5829e11 /unix/modsocket.c
parent4d55d8805aca614ddafdc4a76abc87af60b1371f (diff)
downloadmicropython-d0db93cf1ff8eb8b2db63da07dd14d86577eebd1.tar.gz
micropython-d0db93cf1ff8eb8b2db63da07dd14d86577eebd1.zip
unix/modsocket: Remove unnecessary asserts.
These checks are already made, and errors reported, by the uPy runtime.
Diffstat (limited to 'unix/modsocket.c')
-rw-r--r--unix/modsocket.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/unix/modsocket.c b/unix/modsocket.c
index c7be6461e8..c1f88defce 100644
--- a/unix/modsocket.c
+++ b/unix/modsocket.c
@@ -391,7 +391,6 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_1(mod_socket_htons_obj, mod_socket_htons);
STATIC mp_obj_t mod_socket_gethostbyname(mp_obj_t arg) {
- assert(MP_OBJ_IS_TYPE(arg, &mp_type_str));
const char *s = mp_obj_str_get_str(arg);
struct hostent *h = gethostbyname(s);
if (h == NULL) {
@@ -441,9 +440,7 @@ STATIC mp_obj_t mod_socket_inet_ntop(mp_obj_t family_in, mp_obj_t binaddr_in) {
STATIC MP_DEFINE_CONST_FUN_OBJ_2(mod_socket_inet_ntop_obj, mod_socket_inet_ntop);
STATIC mp_obj_t mod_socket_getaddrinfo(size_t n_args, const mp_obj_t *args) {
- // TODO: Implement all args
- assert(n_args >= 2 && n_args <= 4);
- assert(MP_OBJ_IS_STR(args[0]));
+ // TODO: Implement 5th and 6th args
const char *host = mp_obj_str_get_str(args[0]);
const char *serv = NULL;
@@ -510,7 +507,7 @@ STATIC mp_obj_t mod_socket_getaddrinfo(size_t n_args, const mp_obj_t *args) {
freeaddrinfo(addr_list);
return list;
}
-STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_socket_getaddrinfo_obj, 2, 6, mod_socket_getaddrinfo);
+STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mod_socket_getaddrinfo_obj, 2, 4, mod_socket_getaddrinfo);
STATIC mp_obj_t mod_socket_sockaddr(mp_obj_t sockaddr_in) {
mp_buffer_info_t bufinfo;