def __exit__(self, *args, **kwargs):
        """ Restore stdio and close the file.
        """
        sys.stdout = self.original_stdout
        if self.close_target:
            self.target.close()
 Restore stdio and close the file.
        
recipes/Python/534166_RedirectedIO_context_manager_redirectio/recipe-534166.py