Bug 1048446 - [mozprocess] Allow passing in a function as a value to 'processOutputLine', r?gbrown
MozReview-Commit-ID: Jqyhbj7nC6z
--- a/testing/mozharness/mozprocess/processhandler.py
+++ b/testing/mozharness/mozprocess/processhandler.py
@@ -899,16 +899,19 @@ class ProcessHandler(ProcessHandlerMixin
If logfile is not None, the output produced by the process will be
appended to the given file.
"""
def __init__(self, cmd, logfile=None, storeOutput=True, **kwargs):
kwargs.setdefault('processOutputLine', [])
+ if not isinstance(kwargs['processOutputLine'], (list, tuple)):
+ kwargs['processOutputLine'] = [kwargs['processOutputLine']]
+
# Print to standard output only if no outputline provided
if not kwargs['processOutputLine']:
kwargs['processOutputLine'].append(print_output)
if logfile:
logoutput = LogOutput(logfile)
kwargs['processOutputLine'].append(logoutput)