# HG changeset patch # User timeless # Date 1456816652 0 # Node ID 01815c15985618ba6f580f5e84410b0e5f984c22 # Parent 89e04a33e9583df2a1f8ffc8361d2fb9691646d5 zeroconf: use print function diff -r 89e04a33e958 -r 01815c159856 hgext/zeroconf/Zeroconf.py --- 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 diff -r 89e04a33e958 -r 01815c159856 tests/test-check-py3-compat.t --- 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