# HG changeset patch # User Raphaël Gomès # Date 1721296921 -7200 # Node ID 25e7f9dcad0f54914f7bff176b0f6be1e22937e1 # Parent 1eab9e40c0c87c845372b0889b247c181ef86e1b zeroconf: fix boolean return value This was (wrongly) flagged by Pytype as being undefined since it doesn't seem to understand `try` blocks. However, the caller is expecting a boolean and the fix to appease Pytype is simple, so we do both. diff -r 1eab9e40c0c8 -r 25e7f9dcad0f hgext/zeroconf/Zeroconf.py --- a/hgext/zeroconf/Zeroconf.py Thu Jul 11 21:54:02 2024 -0400 +++ b/hgext/zeroconf/Zeroconf.py Thu Jul 18 12:02:01 2024 +0200 @@ -1307,6 +1307,7 @@ delay = _LISTENER_TIME next = now + delay last = now + timeout + result = False try: zeroconf.addListener( self, DNSQuestion(self.name, _TYPE_ANY, _CLASS_IN) @@ -1352,7 +1353,7 @@ zeroconf.wait(min(next, last) - now) now = currentTimeMillis() - result = 1 + result = True finally: zeroconf.removeListener(self)