# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1560275339 -10800 # Node ID 683aeef12830534d6e681737ac670449bcdf932e # Parent fa2071753dc22c4afbd07e8231e31215a577ac00 py3: add r'' prefixes and do ('%d' % int) instead of str(int) This addresses more failures related to zeroconf on py3. Differential Revision: https://phab.mercurial-scm.org/D6510 diff -r fa2071753dc2 -r 683aeef12830 hgext/zeroconf/Zeroconf.py --- a/hgext/zeroconf/Zeroconf.py Sat Feb 02 12:07:31 2019 -0800 +++ b/hgext/zeroconf/Zeroconf.py Tue Jun 11 20:48:59 2019 +0300 @@ -535,7 +535,7 @@ def readString(self, len): """Reads a string of a given length from the packet""" - format = '!' + str(len) + 's' + format = '!%ds' % len length = struct.calcsize(format) info = struct.unpack(format, self.data[self.offset:self.offset + length]) @@ -613,7 +613,7 @@ def readName(self): """Reads a domain name from the packet""" - result = '' + result = r'' off = self.offset next = -1 first = off @@ -625,7 +625,7 @@ break t = len & 0xC0 if t == 0x00: - result = ''.join((result, self.readUTF(off, len) + '.')) + result = r''.join((result, self.readUTF(off, len) + r'.')) off += len elif t == 0xC0: if next < 0: