For once, Showtime execs had reason to smile watching last week’s episode of HBO’s “The Sopranos,” as mob boss Tony grappled with his feelings about homosexuality during a therapy session — including the prevalence of gay characters on TV.

“The lesbian thing, with Jennifer Beals. It’s not bad,” he allowed.

That “lesbian thing,” of course, would be Showtime’s “The L Word.”

Asked about the free PR from ostensible rival HBO, Showtime Entertainment prexy Robert Greenblatt says, “It doesn’t surprise me at all that Tony Soprano would have a warm place in his heart for the girls of ‘The L Word.’ It’s nice to know that ‘bada bing’ doesn’t discriminate.”

Of course, Showtime doesn’t always receive quite so much respect from other shows. On a recent episode of NBC’s “The Office,” for example, the clueless manager played by Steve Carell appropriated — and muddled — the pay net’s familiar slogan in observing that the Dunder-Mifflin office environment was “like HBO: no limits.”