NEW YORK — Facing a difficult political situation, the Working Families Party at its convention in Harlem on Saturday split the baby: Its state committee members voted to back both law professor Zephyr Teachout and New York City Public Advocate Letitia James for New York attorney general, while installing a party activist, Kenny Schafer, as a temporary placeholder on its ballot line.

The move allows the the progressive WFP to remove Schafer, an attorney, from its ballot line following September's Democratic primary for attorney general, and then endorse either James or Teachout if either emerges victorious from the Democratic contest.

That way, the WFP will not be a spoiler in the November general election by potentially supporting someone with its ballot line other than the Democratic nominee. It took the same tack in the 2013 New York City mayoral race when a number of liberal Democrats were also running.

Gov. Andrew Cuomo cut ties with the WFP after its decision to endorse his Democratic primary challenger, actress and advocate Cynthia Nixon. Under reported pressure from the governor, James announced earlier this week that she would not seek the WFP endorsement, despite a long history with the party: She is the first and only person to win a New York City Council seat running solely on the WFP line.

Her move last week seems to have basically guaranteed that James will win the Democratic Party's backing, with Cuomo's support, at that party's convention next week.

Despite what some saw as a betrayal, James still had support among many of the WFP's leaders in New York City, who blamed Cuomo for the situation, according to a person with knowledge of their thinking.

Teachout also has a history with the party, as she nearly won its nomination in her surprisingly strong Democratic primary for governor against Cuomo in 2014. But she seems a far longer shot to win than James does, and it also would have been difficult for the party to fully abandon James, a person who would be the first woman of color to be attorney general, especially given her long history with the party.

Teachout had been serving as Nixon's campaign treasurer, though she has stepped down from that role to mount her run for attorney general.

"There are two incredible progressive women in this race, and New Yorkers would be lucky to have either as our next Attorney General," said WFP state director Bill Lipton in a statement. "These are two WFP heroes."

Lipton expressed disdain for what the WFP release characterized as the governor's "bullying" tactics: "Cuomo and his machine have only ever helped to elect one man — Andrew Cuomo," he said.

Geoff Berman, executive director of the Cuomo-controlled state Democratic party apparatus, said in his own statement Saturday that "the state of the WFP today stands in stark contrast with the state of the Democratic Party.

"The union-founded party has no working families left after every union has left their ranks. Now Party Boss Bill Lipton is trying to muscle their delegates not to back one of their most loyal supporters: Zephyr Teachout," Berman said.

James took herself out of the running for consideration to be chosen as the Legislature's pick to finish out the term of former Attorney General Eric Schneiderman, who resigned May 8 after the publication of an expose by The New Yorker that accused him of abusing four women.

A Democrat, Schneiderman had been endorsed for a third term by the WFP only two weeks before his resignation.