As expected, an energy efficiency bill failed in the Senate on Monday, which makes a separate Senate vote on the Keystone XL oil pipeline unlikely before the November election.

Senate Majority Leader Harry Reid had made a Keystone vote contingent upon passage of the energy efficiency bill, and letting one doom the other may have temporarily gotten him out of a bind.

Reid faced a dilemma: Some Senate Democrats — especially vulnerable ones running in conservative states this year — want to support the pipeline. That is the 1,200-mile pipeline stretching from western Canada all the way to the Gulf Coast that has yet to be finished.

Most Democrats don't want a vote on Keystone. So Reid devised a way out: Avoid a Senate vote on the pipeline, and blame Republicans for it.

"Look at how Republican obstruction is bringing the Senate to its knees again and again and again," Reid said. "And now even on this bill — a bipartisan bill."

The bill Reid mentioned was one that would have helped increase energy efficiency in federal buildings and private homes.

For days, Reid had said only after that bill passed would he allow a stand-alone vote on Keystone. He then blocked the other side from introducing amendments to change the bill, which made many Republicans, like Sen. John McCain of Arizona, vow they'd in turn block the energy efficiency bill.

"The dictator won't allow us to have any amendments," McCain said. "I mean, it is just unprecedented. I've been around here a long, long time."

And that's the procedural dance that let Senate Democrats avert a Keystone vote this time around.

"This is a tough issue for Democrats," says Frances Lee, American politics professor at the University of Maryland, "because it divides the Democratic Party, and it sets the Democratic Party and Congress against the president."

Lee points out that the president likely would have vetoed any bill giving the green light to build Keystone, and most Democrats don't want that drama with the White House months before the midterm elections.

But where does that leave red-state Democrats facing tough races this year — like Sen. Mary Landrieu of Louisiana?

"They could have had a vote on Keystone," Landrieu says. "They can't take yes for an answer."

Copyright 2016 NPR. To see more, visit http://www.npr.org/.