def shutdown(self):
        """Revert stdin and stdout, close the socket."""
        sys.stdout = self.old_stdout
        sys.stdin = self.old_stdin
        pipes = [
            self.p_A_pipe,
            self.p_B_pipe,
            self.b_A_pipe,
            self.b_B_pipe
        ]
        for pipe in pipes:
            try:
                pipe.close()
            except __HOLE__:
                logger.warning(
                    "IOError encountered while closing a pipe; messages "
                    "may have been lost."
                )
        self.bot.disconnect()
dataset/ETHPy150Open coddingtonbear/ircpdb/ircpdb/debugger.py/Ircpdb.shutdown