From d1166c9415ed8e6a8729bb6b72084f71adf1cd54 Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Tue, 22 Jan 2013 12:58:30 +0000 Subject: Python 3 compatibility --- (limited to 'devbot/command.py') diff --git a/devbot/command.py b/devbot/command.py index b3bd6fc..eb3a3cd 100644 --- a/devbot/command.py +++ b/devbot/command.py @@ -6,7 +6,7 @@ from devbot import config def run(args, test=False, interactive=False, retry=0): if test: - print " ".join(args) + print(" ".join(args)) return log_file = None @@ -23,13 +23,13 @@ def run(args, test=False, interactive=False, retry=0): tries = tries + 1 subprocess.check_call(**subprocess_args) break - except subprocess.CalledProcessError, e: - print "\nCommand failed, tail of %s\n" % config.log_path + except subprocess.CalledProcessError as e: + print("\nCommand failed, tail of %s\n" % config.log_path) if config.log_path: subprocess.call(["tail", config.log_path]) if tries < retry + 1: - print "Retrying (attempt %d) in 1 minute" % tries + print("Retrying (attempt %d) in 1 minute" % tries) time.sleep(60) else: raise e @@ -42,6 +42,6 @@ def run_with_sudo(args, test=False, interactive=False, retry=0): args_with_sudo = ["sudo"] args_with_sudo.extend(args) - print " ".join(args_with_sudo) + print(" ".join(args_with_sudo)) run(args_with_sudo, test=test, retry=retry, interactive=interactive) -- cgit v0.9.1