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>
This commit is contained in:
Damien George 2022-09-26 00:07:58 +10:00
parent e6d3513187
commit 3abcfb9aec
1 changed files with 1 additions and 1 deletions

View File

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