Bug 1048446 - [mozprocess] Allow passing in a function as a value to 'processOutputLine', r=gbrown
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Mon, 29 May 2017 14:30:29 -0400
changeset 413749 f375a096bff95e10f770a779155012ff8647847d
parent 413748 42084b6fc3f926badd3af331876c995312103299
child 413750 525728eff624112eedff5009655cd837c09420bd
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown
bugs1048446
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1048446 - [mozprocess] Allow passing in a function as a value to 'processOutputLine', r=gbrown MozReview-Commit-ID: Jqyhbj7nC6z
testing/mozharness/mozprocess/processhandler.py
--- 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)