Identify a movie from a vague memory - musical disclaimer

I saw part of this movie decades ago on TV; possibly from the 1950s. What I remember is that part of it was about production of a stage musical - and the musical’s plot was based on someone famous (who the people in the movie knew), and the concern was that it would be obvious that the story was based on real life and that the guy might sue. Then someone has a brainstorm and we cut to the stage, showing a group of dancing girls opening the show, singing a disclaimer “this show isn’t based on anyone living or dead; the story all came straight out of the author’s head” (or rhyming words to that effect). The implication was that this was the invention of the “don’t sue us” disclaimer…

Anyone remember this?

Was it the Bob Hope film Louisiana Purchase?

Yes, indeed - at the beginning of the film, not the end - but I remembered the lyrics quite well (the whole film is on Youtube).

Thank you very much!