zeroconf: fix traceback under py3 stable
authorKim Alvefur <zash@zash.se>
Wed, 13 Nov 2019 22:40:32 +0100
branchstable
changeset 43433 0f82b29f7494
parent 43432 53607fd3ec6c
child 43434 c5bcd946a34b
zeroconf: fix traceback under py3 hg serve under py3 caused struct.error: char format requires a bytes object of length 1 <pulkit25> ah, I think that should be `pycompat.bytechr` instead of chr
hgext/zeroconf/Zeroconf.py
--- a/hgext/zeroconf/Zeroconf.py	Sun Nov 17 19:55:01 2019 +0100
+++ b/hgext/zeroconf/Zeroconf.py	Wed Nov 13 22:40:32 2019 +0100
@@ -1191,7 +1191,11 @@
                 list.append(b'='.join((key, suffix)))
             for item in list:
                 result = b''.join(
-                    (result, struct.pack(b'!c', chr(len(item))), item)
+                    (
+                        result,
+                        struct.pack(b'!c', pycompat.bytechr(len(item))),
+                        item,
+                    )
                 )
             self.text = result
         else: