mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Fix mypy pre-commit hook on windows (#1081)
This commit is contained in:
@@ -209,7 +209,8 @@ class _DiscoverProtocol(asyncio.DatagramProtocol):
|
||||
except OSError as ex: # WSL does not support SO_REUSEADDR, see #246
|
||||
_LOGGER.debug("Unable to set SO_REUSEADDR: %s", ex)
|
||||
|
||||
if self.interface is not None:
|
||||
# windows does not support SO_BINDTODEVICE
|
||||
if self.interface is not None and hasattr(socket, "SO_BINDTODEVICE"):
|
||||
sock.setsockopt(
|
||||
socket.SOL_SOCKET, socket.SO_BINDTODEVICE, self.interface.encode()
|
||||
)
|
||||
|
Reference in New Issue
Block a user