hgext/zeroconf/Zeroconf.py
changeset 42551 8306b6c29add
parent 42550 683aeef12830
child 43076 2372284d9457
--- a/hgext/zeroconf/Zeroconf.py	Tue Jun 11 20:48:59 2019 +0300
+++ b/hgext/zeroconf/Zeroconf.py	Tue Jun 11 20:53:14 2019 +0300
@@ -89,6 +89,8 @@
 import time
 import traceback
 
+from mercurial import pycompat
+
 __all__ = ["Zeroconf", "ServiceInfo", "ServiceBrowser"]
 
 # hook for threads
@@ -270,6 +272,8 @@
     """A DNS question entry"""
 
     def __init__(self, name, type, clazz):
+        if pycompat.ispy3 and isinstance(name, str):
+            name = name.encode('ascii')
         if not name.endswith(".local."):
             raise NonLocalNameException(name)
         DNSEntry.__init__(self, name, type, clazz)