zeroconf: use print function
authortimeless <timeless@mozdev.org>
Tue, 01 Mar 2016 07:17:32 +0000
changeset 28295 01815c159856
parent 28294 89e04a33e958
child 28296 a73394e7b47c
zeroconf: use print function
hgext/zeroconf/Zeroconf.py
tests/test-check-py3-compat.t
--- a/hgext/zeroconf/Zeroconf.py	Mon Feb 29 15:12:26 2016 +0100
+++ b/hgext/zeroconf/Zeroconf.py	Tue Mar 01 07:17:32 2016 +0000
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
 """ Multicast DNS Service Discovery for Python, v0.12
     Copyright (C) 2003, Paul Scott-Murphy
 
@@ -1558,23 +1560,23 @@
 # query (for Zoe), and service unregistration.
 
 if __name__ == '__main__':
-	print "Multicast DNS Service Discovery for Python, version", __version__
+	print("Multicast DNS Service Discovery for Python, version", __version__)
 	r = Zeroconf()
-	print "1. Testing registration of a service..."
+	print("1. Testing registration of a service...")
 	desc = {'version':'0.10','a':'test value', 'b':'another value'}
 	info = ServiceInfo("_http._tcp.local.", "My Service Name._http._tcp.local.", socket.inet_aton("127.0.0.1"), 1234, 0, 0, desc)
-	print "   Registering service..."
+	print("   Registering service...")
 	r.registerService(info)
-	print "   Registration done."
-	print "2. Testing query of service information..."
-	print "   Getting ZOE service:", str(r.getServiceInfo("_http._tcp.local.", "ZOE._http._tcp.local."))
-	print "   Query done."
-	print "3. Testing query of own service..."
-	print "   Getting self:", str(r.getServiceInfo("_http._tcp.local.", "My Service Name._http._tcp.local."))
-	print "   Query done."
-	print "4. Testing unregister of service information..."
+	print("   Registration done.")
+	print("2. Testing query of service information...")
+	print("   Getting ZOE service:", str(r.getServiceInfo("_http._tcp.local.", "ZOE._http._tcp.local.")))
+	print("   Query done.")
+	print("3. Testing query of own service...")
+	print("   Getting self:", str(r.getServiceInfo("_http._tcp.local.", "My Service Name._http._tcp.local.")))
+	print("   Query done.")
+	print("4. Testing unregister of service information...")
 	r.unregisterService(info)
-	print "   Unregister done."
+	print("   Unregister done.")
 	r.close()
 
 # no-check-code
--- a/tests/test-check-py3-compat.t	Mon Feb 29 15:12:26 2016 +0100
+++ b/tests/test-check-py3-compat.t	Tue Mar 01 07:17:32 2016 +0000
@@ -87,7 +87,6 @@
   hgext/win32mbcs.py not using absolute_import
   hgext/win32text.py not using absolute_import
   hgext/zeroconf/Zeroconf.py not using absolute_import
-  hgext/zeroconf/Zeroconf.py requires print_function
   hgext/zeroconf/__init__.py not using absolute_import
   i18n/check-translation.py not using absolute_import
   i18n/polib.py not using absolute_import