summaryrefslogtreecommitdiff
path: root/dns
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2020-08-13 08:08:19 -0700
committerBob Halley <halley@dnspython.org>2020-08-13 08:08:19 -0700
commit665b61e1ff85f8904a0bb6d8780ff23759cadfb0 (patch)
tree5814b0bad6743cb3d112221c8ece489f3a330772 /dns
parent677c3c03c91d5d758e2f7a225a7455d9b2b5da24 (diff)
downloaddnspython-665b61e1ff85f8904a0bb6d8780ff23759cadfb0.tar.gz
Do not try to set a future that is already set. [#572]
Diffstat (limited to 'dns')
-rw-r--r--dns/_asyncio_backend.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/dns/_asyncio_backend.py b/dns/_asyncio_backend.py
index 1cf1519..6a56332 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):