Import io.StringIO if StringIO does not exist.