]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Make Coverity happier [#882].
authorBob Halley <halley@dnspython.org>
Thu, 12 Jan 2023 22:00:52 +0000 (14:00 -0800)
committerBob Halley <halley@dnspython.org>
Thu, 12 Jan 2023 22:00:52 +0000 (14:00 -0800)
dns/_asyncio_backend.py

index d8257658baded0842455057ae2bf37306e9e4531..82a06249733567c3985dbc403ce2cb9f46bc2e08 100644 (file)
@@ -145,6 +145,10 @@ class Backend(dns._asyncbackend.Backend):
             )
             return DatagramSocket(af, transport, protocol)
         elif socktype == socket.SOCK_STREAM:
+            if destination is None:
+                # This shouldn't happen, but we check to make code analysis software
+                # happier.
+                raise ValueError("destination required for stream sockets")
             (r, w) = await _maybe_wait_for(
                 asyncio.open_connection(
                     destination[0],