diff options
| author | Bob Halley <halley@dnspython.org> | 2020-08-13 08:08:19 -0700 |
|---|---|---|
| committer | Bob Halley <halley@dnspython.org> | 2020-08-13 08:08:19 -0700 |
| commit | 665b61e1ff85f8904a0bb6d8780ff23759cadfb0 (patch) | |
| tree | 5814b0bad6743cb3d112221c8ece489f3a330772 /dns | |
| parent | 677c3c03c91d5d758e2f7a225a7455d9b2b5da24 (diff) | |
| download | dnspython-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.py | 4 |
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): |
