add pass-through attribute getters to CompletedProcess

This commit is contained in:
adam j hartz 2016-03-02 22:07:44 -05:00
parent 05e762aadd
commit 4f6bab539b

View file

@ -654,6 +654,11 @@ class CompletedProcess:
def __eq__(self, other):
return self.proc.returncode == other
def __getattr__(self, attr):
if hasattr(self.proc, attr):
return getattr(self.proc, attr)
raise AttributeError('CompletedProcess instance has no attribute: %r' % attr)
def subproc_captured_stdout(*cmds):
"""Runs a subprocess, capturing the output. Returns the stdout