aboutsummaryrefslogtreecommitdiffstats
path: root/lib/toaster/toastermain
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-09 14:05:09 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-09 17:32:13 +0100
commit58304fcce9727fd89564436771356c033ecd22a3 (patch)
tree88daa489e0e67245dca71a8d1daf783cf5a00308 /lib/toaster/toastermain
parentb60261bf8ade14aca31238b50c243c01adcabc59 (diff)
downloadbitbake-contrib-58304fcce9727fd89564436771356c033ecd22a3.tar.gz
bin, toaster: Fix print and exception syntax
This updates the print "" syntax to print() and fixes some exception handling syntax such that its compatible with python v2 and v3. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/toaster/toastermain')
-rw-r--r--lib/toaster/toastermain/management/commands/builddelete.py2
-rw-r--r--lib/toaster/toastermain/management/commands/buildslist.py2
-rw-r--r--lib/toaster/toastermain/management/commands/get-dburl.py2
-rw-r--r--lib/toaster/toastermain/management/commands/perf.py6
-rw-r--r--lib/toaster/toastermain/settings.py2
5 files changed, 7 insertions, 7 deletions
diff --git a/lib/toaster/toastermain/management/commands/builddelete.py b/lib/toaster/toastermain/management/commands/builddelete.py
index ff93e549d..0bef8d410 100644
--- a/lib/toaster/toastermain/management/commands/builddelete.py
+++ b/lib/toaster/toastermain/management/commands/builddelete.py
@@ -15,7 +15,7 @@ class Command(BaseCommand):
try:
b = Build.objects.get(pk = bid)
except ObjectDoesNotExist:
- print 'build %s does not exist, skipping...' %(bid)
+ print('build %s does not exist, skipping...' %(bid))
continue
# theoretically, just b.delete() would suffice
# however SQLite runs into problems when you try to
diff --git a/lib/toaster/toastermain/management/commands/buildslist.py b/lib/toaster/toastermain/management/commands/buildslist.py
index cad987fd9..8dfef0aa0 100644
--- a/lib/toaster/toastermain/management/commands/buildslist.py
+++ b/lib/toaster/toastermain/management/commands/buildslist.py
@@ -10,4 +10,4 @@ class Command(NoArgsCommand):
def handle_noargs(self,**options):
for b in Build.objects.all():
- print "%d: %s %s %s" % (b.pk, b.machine, b.distro, ",".join([x.target for x in b.target_set.all()]))
+ print("%d: %s %s %s" % (b.pk, b.machine, b.distro, ",".join([x.target for x in b.target_set.all()])))
diff --git a/lib/toaster/toastermain/management/commands/get-dburl.py b/lib/toaster/toastermain/management/commands/get-dburl.py
index 22b3eb79e..911296f71 100644
--- a/lib/toaster/toastermain/management/commands/get-dburl.py
+++ b/lib/toaster/toastermain/management/commands/get-dburl.py
@@ -6,4 +6,4 @@ class Command(NoArgsCommand):
help = "get database url"
def handle_noargs(self,**options):
- print getDATABASE_URL()
+ print(getDATABASE_URL())
diff --git a/lib/toaster/toastermain/management/commands/perf.py b/lib/toaster/toastermain/management/commands/perf.py
index 71a48e95d..6b450bbdf 100644
--- a/lib/toaster/toastermain/management/commands/perf.py
+++ b/lib/toaster/toastermain/management/commands/perf.py
@@ -25,7 +25,7 @@ class Command(BaseCommand):
info = self.url_info(full_url)
status_code = info[0]
load_time = info[1]
- print 'Trying \'' + full_url + '\', ' + str(status_code) + ', ' + str(load_time)
+ print('Trying \'' + full_url + '\', ' + str(status_code) + ', ' + str(load_time))
def get_full_url(self, url_patt, url_root_res):
full_url = str(url_patt).split('^')[1].replace('$>', '').replace('(?P<file_path>(?:/[', '/bin/busybox').replace('.*', '')
@@ -54,5 +54,5 @@ class Command(BaseCommand):
def error(self, *args):
for arg in args:
- print >>sys.stderr, arg,
- print >>sys.stderr
+ print(arg, end=' ', file=sys.stderr)
+ print(file=sys.stderr)
diff --git a/lib/toaster/toastermain/settings.py b/lib/toaster/toastermain/settings.py
index 74ab60462..8662f393a 100644
--- a/lib/toaster/toastermain/settings.py
+++ b/lib/toaster/toastermain/settings.py
@@ -138,7 +138,7 @@ else:
try:
if pytz.timezone(zonename) is not None:
zonefilelist[hashlib.md5(open(filepath).read()).hexdigest()] = zonename
- except UnknownTimeZoneError, ValueError:
+ except UnknownTimeZoneError as ValueError:
# we expect timezone failures here, just move over
pass
except ImportError: