From 3abcfb9aecd567c4c74fd3c99703f23c372b7445 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 26 Sep 2022 00:07:58 +1000 Subject: [PATCH] esp32/modsocket: Use mp_obj_is_integer to test port type. Because the value may be a big integer, which is still a valid type to use. Fixes issue #9410. Signed-off-by: Damien George --- ports/esp32/modsocket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/esp32/modsocket.c b/ports/esp32/modsocket.c index 334c5bae33..9812eb3476 100644 --- a/ports/esp32/modsocket.c +++ b/ports/esp32/modsocket.c @@ -214,7 +214,7 @@ static int _socket_getaddrinfo2(const mp_obj_t host, const mp_obj_t portx, struc }; mp_obj_t port = portx; - if (mp_obj_is_small_int(port)) { + if (mp_obj_is_integer(port)) { // This is perverse, because lwip_getaddrinfo promptly converts it back to an int, but // that's the API we have to work with ... port = mp_obj_str_binary_op(MP_BINARY_OP_MODULO, mp_obj_new_str_via_qstr("%s", 2), port);