Nevermind on that idea: I came up with a better one (see my comment below `capture_stream`...): make a base class and two subclasses -- one for stdout, one for stderr.