Browse Source

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 <damien@micropython.org>
pull/9412/head
Damien George 2 years ago
parent
commit
3abcfb9aec
  1. 2
      ports/esp32/modsocket.c

2
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);

Loading…
Cancel
Save