Handle one interaction at a time until shutdown.

        :param banner: (optional) the banner to print before the first
                       interaction. Defaults to ``None``.

def serve_forever(self, banner=None):
        """Handle one interaction at a time until shutdown.

        :param banner: (optional) the banner to print before the first
                       interaction. Defaults to ``None``.
        """
        if banner:
            print(banner)
        while True:
            try:
                self.interact()
            except KeyboardInterrupt:  # program interrupted by the user
                print  # do not print on the same line as ^C
                pass
            except SystemExit:  # exit from the interpreter
                break