kopia lustrzana https://github.com/micropython/micropython-lib
socket: Native struct sockaddr may come as bytes or bytearray.
rodzic
89480056ed
commit
8bb6857818
|
@ -8,7 +8,7 @@ IP_ADD_MEMBERSHIP = 35
|
||||||
IP_DROP_MEMBERSHIP = 36
|
IP_DROP_MEMBERSHIP = 36
|
||||||
|
|
||||||
def _resolve_addr(addr):
|
def _resolve_addr(addr):
|
||||||
if isinstance(addr, bytes):
|
if isinstance(addr, (bytes, bytearray)):
|
||||||
return addr
|
return addr
|
||||||
if len(addr) != 2:
|
if len(addr) != 2:
|
||||||
raise NotImplementedError("Only IPv4 supported")
|
raise NotImplementedError("Only IPv4 supported")
|
||||||
|
|
Ładowanie…
Reference in New Issue