From c62b6858897306d25ac6018bc11d6abb39733bac Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Tue, 22 Apr 2014 13:18:40 +0200 Subject: Use print as function to make python3 happy --- whatmaps/command.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/whatmaps/command.py b/whatmaps/command.py index 14e56b7..3e8773b 100755 --- a/whatmaps/command.py +++ b/whatmaps/command.py @@ -16,6 +16,8 @@ # along with this program. If not, see . # +from __future__ import print_function + import glob import os import logging @@ -97,10 +99,10 @@ def detect_distro(): def write_cmd_file(services, cmd_file, distro): "Write out commands needed to restart the services to a file" out = open(cmd_file, 'w') - print >>out, '#! /bin/sh' + print('#! /bin/sh', file=out) for service in services: logging.debug("Need to restart %s", service) - print >>out, " ".join(distro.restart_service_cmd(service)) + print(" ".join(distro.restart_service_cmd(service)), file=out) out.close() os.chmod(cmd_file, 0755) @@ -218,9 +220,9 @@ def main(argv): logging.info("Restarting %s" % service) distro.restart_service(service) elif all_services: - print "Services that possibly need to be restarted:" + print("Services that possibly need to be restarted:") for s in all_services: - print s + print(s) return 0 -- cgit v1.2.3