Producers of NBC’s re-booted 90s sitcom Will & Grace say the recent episode featuring Grace’s sexual assault was inspired by both the Brett Kavanaugh Senate hearings and the trail that sent comedian Bill Cosby to jail.

The episode featured an emotional scene where Grace (Debra Messing) told her father Martin (guest star Robert Klein) that his best friend “Harry” sexually molested her when she was 15.

Will & Grace co-creator Max Mutchnick told The Hollywood Reporter that the episode was envisioned after the trial of comedy icon Bill Cosby who was eventually handed a three to ten-year prison sentence for sexual assault.

“This episode was an outgrowth of what was going on with the Bill Cosby case,” Mutchnick said. “We were very taken by the raw coverage of these stories and what made them so potent was the fact that we were hearing the specifics about what had happened to these women,” he added.

Naturally, Messing, who is a virulent liberal who often spews hate against President Donald Trump, Republicans, and conservatives on Twitter, was all in for the episode, producers said.

Mutchnick continued saying that the Cosby accusers were “loud and proud” and did not hide their accusations in “dark corners.” After that testimony, he said, “We came into the room and started talking about, how can we write to some of this in the show?”

The producers also said they worked to be sure to be as graphic and harsh as possible.

“There was never going to be a line where Grace said on this sitcom, ‘He touched me down there.’ It was always going to be something specific and graphic, and we just had to figure out how far we wanted to take it and what felt right for the show,” Mutchnick said.

Indeed, the finished product has Grace telling her father that his best friend “pulled down my pants and put his fingers up…”

The Bill Cosby trial was not the only influence for the episode. Producers were also influenced by the uncorroborated testimony delivered in October against Supreme Court Justice Brett Kavanaugh by Christine Blasey Ford.

Specifically, one line was added to the scene where Grace’s father says that maybe she “misremembered” the attack she said happened when she was a teen. This comes from those who said that maybe Blasey Ford did experience a sexual assault when she was a teen but maybe misremembered the identity of her attacker.

“There is something so upsetting and condescending and minimizing about somebody saying, ‘Hey, I believe this happened to you, but maybe you’re misremembering the person,'” co-producer David Kohan said. “It’s so incredible, and that is basically the lie that people have to believe if they say, ‘I’m going to believe Dr. Ford, but I’m also going to believe Brett Kavanaugh.’ Of course, it’s absurd. For an entire political party to try to walk that tightrope is insane.'”

Apparently, the fact that every single person Blasey Ford said witnessed this event disavowed the accuser’s claims made no impression on the producers of Will & Grace.

Follow Warner Todd Huston on Twitter @warnerthuston.