Bug 1820139 - Add an early return mechanism to line handling. r=ahal

Differential Revision: https://phabricator.services.mozilla.com/D171546
This commit is contained in:
Arthur Carcano 2023-03-23 00:46:31 +00:00
Родитель f0eef2cdca
Коммит 2907b87962
1 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -47,6 +47,10 @@ if (
_current_shell += ".exe"
class LineHandlingEarlyReturn(Exception):
pass
class ProcessExecutionMixin(LoggingMixin):
"""Mix-in that provides process execution functionality."""
@ -111,7 +115,10 @@ class ProcessExecutionMixin(LoggingMixin):
line = line.decode(sys.stdout.encoding or "utf-8", "replace")
if line_handler:
line_handler(line)
try:
line_handler(line)
except LineHandlingEarlyReturn:
return
if line.startswith("BUILDTASK") or not log_name:
return