A presidential election year is not typically the most opportune time to pass ambitious, complicated and controversial bills through Congress. But it appears there is still hope for action this year on the politically sensitive topic of criminal-justice reform.

A bipartisan group of senators announced revisions Thursday to a bill easing federal sentencing guidelines for non-violent offenders and allowing many of those already incarcerated — most of them drug offenders — to petition a judge for reductions in their jail terms.

The changes have been enough to win the support of key advocates and several additional Republican senators, who have been divided over whether the reforms represent wise fiscal and justice policy or whether they are an imprudent loosening of criminal penalties.

One crucial endorsement came this week from the National District Attorneys Association, which said the latest version of the bill “strikes the appropriate balance between targeting the highest level drug traffickers plaguing our communities, while simultaneously decreasing crime rates and addressing the burgeoning prison population.”

“I think we’ve got some momentum,” said Sen. John Cornyn (R-Tex.), the No. 2 GOP leader and Judiciary Committee member who crafted the legislation with Sens. Mike Lee (R-Utah),  Richard J. Durbin (D-Ill.) and other senators of both parties.

The crucial question now is whether Senate Majority Leader Mitch McConnell (R-Ky.) will bring the bill to the floor. McConnell has been largely mum on the sentencing-reform effort, given the divides within the Republican caucus, but he has otherwise been eager to pass bipartisan bills to show that the Senate is functioning.

Floor time for the bill may be hard to secure, however, if McConnell follows through on his pledge to process appropriations bills for the next two and a half months before Congress breaks for an extended summer recess. But there are new signs that the appropriations process could stall, and Cornyn said Thursday that “if there is floor time that opens up, we want to make sure we’re one of the candidates for consideration.”

Judiciary Committee Chairman Charles E. Grassley (R-Iowa) said he has not yet asked McConnell to bring the bill to the floor but said such a discussion is forthcoming: “I knew that we had to get more co-sponsors and refine the bill so that other people would be comfortable with it, and I think it’s time for those discussions to start right now.”

McConnell spokesman David Popp said “discussions continue” among the GOP senators about how to proceed with the bill.

Meanwhile, in the House, Speaker Paul D. Ryan (R-Wis.) said Thursday that he was “optimistic and hopeful” that his chamber would act on a package of criminal justice reform measures that could be reconciled with a Senate bill. “We’ll bring bills to the floor, which I believe we’ll pass, and then we’ll go to a conference committee,” he said.

But political pitfalls remain — most notably, a group of Republican senators who remain strongly opposed to any significant easing of criminal sentences.

Sen. David Perdue (R-Ga.), a Judiciary Committee member, said the revised bill would still “allow dangerous felons, many of whom have multiple prior convictions for violent crimes, out of prison early.”

“The idea that we are only allowing low-level criminals out of jail is a smoke screen,” he said in a statement circulated Thursday. “As currently written, this bill would put thousands of dangerous felons back on the streets early, potentially endangering our families and communities, and therefore I still cannot support it.”

Other notable opponents of the previous version of the bill include Sen. Ted Cruz (R-Tex.), a presidential candidate who pivoted hard into a tough-on-crime stance earlier this year, and Sen. Jeff Sessions (R-Ala.), an adviser to presidential front-runner Donald Trump. Sharp opposition from either presidential candidate could torpedo the revised bill’s chances this year.

Cornyn pushed back on the soft-on-crime critique in a floor address Thursday, telling critics that “it’s just not true” that violent criminals will be released and to “take another look at the legislation.”

The revisions tightened the eligibility under the previous version of the bill of certain violent offenders to seek a retroactive early release, while expanding the relief available to non-violent offenders. They also eliminated provisions that would have loosened sentence enhancements for repeat offenders who commit crimes with firearms and create a new mandatory minimum sentence for crimes involving fentanyl, a frequently abused opioid narcotic.

Those changes have prompted groans from advocates pushing for sentencing reforms, who argue that lawmakers are watering down the bill too much in their bid to push this bill this year. Julie Stewart, founder and president of Families Against Mandatory Minimums, said the bill “was very modest to begin with, and Congress should be strengthening it, not weakening it.”

The bill now has 37 co-sponsors, and the senators leading the effort would not explicitly say that they have commitments from the 60 senators necessary to get the bill through the Senate. But Sen. Sheldon Whitehouse (D-R.I.) said there is a “strong expectation” that the bill will gain that level of support, and he said he was not concerned by the concessions that have been made to get there.

“There was a lot that was left on the cutting-room floor,” he said. “But I think it’s still a hell of a good movie.”