From: Bob Halley Date: Thu, 13 Aug 2020 15:08:19 +0000 (-0700) Subject: Do not try to set a future that is already set. [#572] X-Git-Tag: v2.1.0rc1~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=665b61e1ff85f8904a0bb6d8780ff23759cadfb0;p=thirdparty%2Fdnspython.git Do not try to set a future that is already set. [#572] --- diff --git a/dns/_asyncio_backend.py b/dns/_asyncio_backend.py index 1cf15192..6a563326 100644 --- a/dns/_asyncio_backend.py +++ b/dns/_asyncio_backend.py @@ -30,11 +30,11 @@ class _DatagramProtocol: self.recvfrom = None def error_received(self, exc): # pragma: no cover - if self.recvfrom: + if self.recvfrom and not self.recvfrom.done(): self.recvfrom.set_exception(exc) def connection_lost(self, exc): - if self.recvfrom: + if self.recvfrom and not self.recvfrom.done(): self.recvfrom.set_exception(exc) def close(self):