Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions src/buildstream/_frontend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,16 @@ def initialized(self, *, session_name=None):
self.stream.init()

# Create our status printer, only available in interactive
self._status = Status(
self.context,
self._state,
self._content_profile,
self._format_profile,
self._success_profile,
self._error_profile,
self.stream,
)
if self.interactive:
self._status = Status(
self.context,
self._state,
self._content_profile,
self._format_profile,
self._success_profile,
self._error_profile,
self.stream,
)

# Mark the beginning of the session
if session_name:
Expand Down Expand Up @@ -589,7 +590,6 @@ def _interrupt_handler(self):

# Only handle ^C interactively in interactive mode
if not self.interactive:
self._status.clear()
self.stream.terminate()
return

Expand Down Expand Up @@ -660,7 +660,8 @@ def _job_failed(self, task_id, element=None):
# XXX This is dangerous, sometimes we get the job completed *before*
# the failure message reaches us ??
if not failure:
self._status.clear()
if self._status:
self._status.clear()
click.echo(
"\n\n\nBUG: Message handling out of sync, "
+ "unable to retrieve failure message for element {}\n\n\n\n\n".format(task.full_name),
Expand Down Expand Up @@ -853,7 +854,8 @@ def _message_handler(self, message, is_silenced):

@contextmanager
def _interrupted(self):
self._status.clear()
if self._status:
self._status.clear()
try:
with self.stream.suspend():
yield
Expand Down
Loading