summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbst-marge-bot <marge-bot@buildstream.build>2019-03-20 09:24:22 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-03-20 09:24:22 +0000
commitbbc5c972a11bd817a5d051aad6b5f791670b6812 (patch)
tree3676589e20fd890f10d2058630eb4e6df7440191
parent1b7f59f8639500f995dbc76470848768656695a7 (diff)
parentc7c837f2c805524ea83b3847559c8c6fa164f0c0 (diff)
downloadbuildstream-bbc5c972a11bd817a5d051aad6b5f791670b6812.tar.gz
Merge branch 'aevri/str_e' into 'master'
app.py: str(e) instead of "{}".format(e) See merge request BuildStream/buildstream!1236
-rw-r--r--buildstream/_frontend/app.py8
-rw-r--r--buildstream/_frontend/widget.py2
-rw-r--r--buildstream/_stream.py2
-rw-r--r--buildstream/sandbox/_sandboxchroot.py2
4 files changed, 7 insertions, 7 deletions
diff --git a/buildstream/_frontend/app.py b/buildstream/_frontend/app.py
index c1a5e57b7..67fcc8370 100644
--- a/buildstream/_frontend/app.py
+++ b/buildstream/_frontend/app.py
@@ -272,7 +272,7 @@ class App():
self._message(MessageType.FAIL, session_name, elapsed=elapsed)
# Notify session failure
- self._notify("{} failed".format(session_name), "{}".format(e))
+ self._notify("{} failed".format(session_name), e)
if self._started:
self._print_summary()
@@ -431,7 +431,7 @@ class App():
#
def _notify(self, title, text):
if self.interactive:
- self.notify(title, text)
+ self.notify(str(title), str(text))
# Local message propagator
#
@@ -658,7 +658,7 @@ class App():
#
def _error_exit(self, error, prefix=None):
click.echo("", err=True)
- main_error = "{}".format(error)
+ main_error = str(error)
if prefix is not None:
main_error = "{}: {}".format(prefix, main_error)
@@ -666,7 +666,7 @@ class App():
if error.detail:
indent = " " * INDENT
detail = '\n' + indent + indent.join(error.detail.splitlines(True))
- click.echo("{}".format(detail), err=True)
+ click.echo(detail, err=True)
sys.exit(-1)
diff --git a/buildstream/_frontend/widget.py b/buildstream/_frontend/widget.py
index 15bd9cf79..45be6d136 100644
--- a/buildstream/_frontend/widget.py
+++ b/buildstream/_frontend/widget.py
@@ -486,7 +486,7 @@ class LogLine(Widget):
values["Session Start"] = starttime.strftime('%A, %d-%m-%Y at %H:%M:%S')
values["Project"] = "{} ({})".format(project.name, project.directory)
values["Targets"] = ", ".join([t.name for t in stream.targets])
- values["Cache Usage"] = "{}".format(context.get_cache_usage())
+ values["Cache Usage"] = str(context.get_cache_usage())
text += self._format_values(values)
# User configurations
diff --git a/buildstream/_stream.py b/buildstream/_stream.py
index 4a21f5002..3276b4081 100644
--- a/buildstream/_stream.py
+++ b/buildstream/_stream.py
@@ -553,7 +553,7 @@ class Stream():
try:
self._artifacts.remove(ref, defer_prune=True)
except CASCacheError as e:
- self._message(MessageType.WARN, "{}".format(e))
+ self._message(MessageType.WARN, str(e))
continue
self._message(MessageType.INFO, "Removed: {}".format(ref))
diff --git a/buildstream/sandbox/_sandboxchroot.py b/buildstream/sandbox/_sandboxchroot.py
index 71422476a..7266a00e3 100644
--- a/buildstream/sandbox/_sandboxchroot.py
+++ b/buildstream/sandbox/_sandboxchroot.py
@@ -188,7 +188,7 @@ class SandboxChroot(Sandbox):
# Exceptions in preexec_fn are simply reported as
# 'Exception occurred in preexec_fn', turn these into
# a more readable message.
- if '{}'.format(e) == 'Exception occurred in preexec_fn.':
+ if str(e) == 'Exception occurred in preexec_fn.':
raise SandboxError('Could not chroot into {} or chdir into {}. '
'Ensure you are root and that the relevant directory exists.'
.format(rootfs, cwd)) from e