From a33a3a3a83394ce0fe8295a6fa604caae973264b Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Fri, 30 Oct 2020 12:51:13 -0400 Subject: [PATCH] fix socket type for python 3.8 --- aioupnp/protocols/multicast.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aioupnp/protocols/multicast.py b/aioupnp/protocols/multicast.py index 76adb0c..4dd7deb 100644 --- a/aioupnp/protocols/multicast.py +++ b/aioupnp/protocols/multicast.py @@ -3,6 +3,7 @@ import socket import typing from asyncio.protocols import DatagramProtocol from asyncio.transports import DatagramTransport +from asyncio.trsock import TransportSocket from unittest import mock @@ -10,7 +11,7 @@ def _get_sock(transport: typing.Optional[DatagramTransport]) -> typing.Optional[ if transport is None or not hasattr(transport, "_extra"): return None sock: typing.Optional[socket.socket] = transport.get_extra_info('socket', None) - assert sock is None or isinstance(sock, (socket.SocketType, mock.MagicMock)) + assert sock is None or isinstance(sock, (socket.SocketType, TransportSocket, mock.MagicMock)) return sock