def _tap_output(self): self.stdout = _TeedStream(self.stdout) self.stderr = _TeedStream(self.stderr) if True: sys.stdout = self.stdout sys.stderr = self.stderr