def _write(self, output: str) -> None:
    'Handle logic of whether to use an output file or print().'
    if (self.output_fd is not None):
        self.output_fd.write((output + self.newline))
    if ((self.output_fd is None) or self.options.tee):
        sys.stdout.buffer.write((output.encode() + self.newline.encode()))
Handle logic of whether to use an output file or print().
def _write(self, output: str) -> None:
    
    if (self.output_fd is not None):
        self.output_fd.write((output + self.newline))
    if ((self.output_fd is None) or self.options.tee):
        sys.stdout.buffer.write((output.encode() + self.newline.encode()))