]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Do not set asyncio future if it is already done. [#740]
authorBob Halley <halley@dnspython.org>
Fri, 17 Dec 2021 16:19:46 +0000 (08:19 -0800)
committerBob Halley <halley@dnspython.org>
Fri, 17 Dec 2021 16:19:46 +0000 (08:19 -0800)
dns/_asyncio_backend.py

index 4c8c0548163a08718f3fb1660969b4055c43b7d0..d737d13c7e4421d05d4510164819a654786963ab 100644 (file)
@@ -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