zeroconf: fix a warning about a signature mismatch in a method override
Caught by PyCharm. It looks like the `hdr` arg is mostly unused (thus why it
was missing in some cases), so pass along an empty string where needed.
--- a/hgext/zeroconf/Zeroconf.py Mon Oct 07 23:24:28 2024 -0400
+++ b/hgext/zeroconf/Zeroconf.py Sun Oct 13 14:46:23 2024 +0200
@@ -379,7 +379,7 @@
"""Abstract method"""
raise AbstractMethodException
- def toString(self, other):
+ def toString(self, hdr, other):
"""String representation with additional information"""
arg = b"%s/%s,%s" % (
self.ttl,
@@ -457,7 +457,7 @@
def __repr__(self):
"""String representation"""
- return self.toString(self.alias)
+ return self.toString(b'', self.alias)
class DNSText(DNSRecord):
@@ -480,9 +480,9 @@
def __repr__(self):
"""String representation"""
if len(self.text) > 10:
- return self.toString(self.text[:7] + b"...")
+ return self.toString(b'', self.text[:7] + b"...")
else:
- return self.toString(self.text)
+ return self.toString(b'', self.text)
class DNSService(DNSRecord):
@@ -515,7 +515,7 @@
def __repr__(self):
"""String representation"""
- return self.toString(b"%s:%s" % (self.server, self.port))
+ return self.toString(b'', b"%s:%s" % (self.server, self.port))
class DNSIncoming: