From: Bob Halley Date: Sat, 1 May 2021 21:19:16 +0000 (-0700) Subject: If a message handler returned None, do not yield it to the caller. X-Git-Tag: v2.2.0rc1~91^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3deb941a5434a35a8ba81b6cee006677d9d566dc;p=thirdparty%2Fdnspython.git If a message handler returned None, do not yield it to the caller. This is a bit cleaner than yielding it and having the caller throw an exception trying to treat it as a message. --- diff --git a/tests/nanonameserver.py b/tests/nanonameserver.py index 18ba6c55..5c9a9c7e 100644 --- a/tests/nanonameserver.py +++ b/tests/nanonameserver.py @@ -237,7 +237,7 @@ class Server(threading.Thread): out = thing.to_wire(self.origin, multi=multi, tsig_ctx=tsig_ctx) tsig_ctx = thing.tsig_ctx yield out - else: + elif thing is not None: yield thing async def serve_udp(self):