From: Bob Halley Date: Fri, 17 Dec 2021 16:19:46 +0000 (-0800) Subject: Do not set asyncio future if it is already done. [#740] X-Git-Tag: v2.2.0rc1~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d6e4ff11a208c14fad28fc699426b0a2f8be8f9;p=thirdparty%2Fdnspython.git Do not set asyncio future if it is already done. [#740] --- diff --git a/dns/_asyncio_backend.py b/dns/_asyncio_backend.py index 4c8c0548..d737d13c 100644 --- a/dns/_asyncio_backend.py +++ b/dns/_asyncio_backend.py @@ -28,7 +28,7 @@ class _DatagramProtocol: self.transport = transport def datagram_received(self, data, addr): - if self.recvfrom: + if self.recvfrom and not self.recvfrom.done(): self.recvfrom.set_result((data, addr)) self.recvfrom = None