Tests pass on Python 3.

This commit is contained in:
Itamar Turner-Trauring
2021-05-11 11:56:21 -04:00
parent 070691caa2
commit 4043b2fe1f
2 changed files with 11 additions and 7 deletions

View File

@ -57,9 +57,10 @@ class _CollectOutputProtocol(ProcessProtocol):
self.output, and callback's on done with all of it after the
process exits (for any reason).
"""
def __init__(self):
def __init__(self, capture_stderr=True):
self.done = Deferred()
self.output = BytesIO()
self.capture_stderr = capture_stderr
def processEnded(self, reason):
if not self.done.called:
@ -74,7 +75,8 @@ class _CollectOutputProtocol(ProcessProtocol):
def errReceived(self, data):
print("ERR: {!r}".format(data))
self.output.write(data)
if self.capture_err:
self.output.write(data)
class _DumpOutputProtocol(ProcessProtocol):