Whom can we blame? How will it play in November?

For the second time in a week, those were the crass calculations running through the minds of the political class. First it was the pipe bombs and now it is the Pittsburgh synagogue massacre.

In both cases, the instant assumption was that the allegiance of the perpetrator would determine which side would be punished in the midterms and which side would reap the benefits of sympathy.

If this sounds heartless and ghoulish, welcome to America. The politicization of everything is exacting a terrible price on our country, with no crime or tragedy too heinous to exploit.

As the number of pipe bombs grew and it became clear that all the targets were Democrats or fierce critics of President Trump, most fingers pointed in the obvious direction. Much of the media rushed to blame the president, and Dem congressional leaders Chuck Schumer and Nancy Pelosi piled on, even denouncing Trump’s call for national unity.

“Time and time again, the president has condoned physical violence and divided Americans with his words and his actions,” they said in a statement that was remarkably harsh and partisan given that the suspect was still at large and fear was growing by the day.

Meanwhile, the pattern of targets was too obvious for some in the president’s corner, and they smelled a “false flag” operation. They suspected the bombs were a plant by the left to put the blame on Trump and swing the coming election to the Dems.

But now that we know that suspect Cesar Sayoc, 56, is indeed a Trump supporter, we are back to the original assumptions. Phrases such as “MAGA Bomber” and “Native American Trump Supporter” who drove a “Trump Mobile” convey the tone of most of the media, with some coverage veering into a “we told you so” smugness.

For the 1 millionth time, they were sure this would be the final straw in his popularity. Happy days would soon be here again.

And then came Saturday’s slaughter, which scrambles the political playbook because it defies easy assumptions about the fallout.

Suspect Robert Bowers is a sick anti-Semite, the carrier of a disease nearly as old as mankind. Because of that, he is no fan of Trump, as he has said on ­social-media posts.

For Bowers, Jews are the everything, the sole measuring rod of all things, which makes Trump part of the problem. The president, after all, is a strong supporter of Israel and his daughter Ivanka converted to Judaism to marry Jared Kushner. The fact that Trump also dared to criticize white nationalists after the Charlottesville, Va., incident is proof he cannot be trusted, according to Bowers’ Nazi-like rants.

Still, that distinction may be buried in the rush to gain an edge, and the anti-Trumpers may be correct that the horrors will persuade enough voters in key districts and states that the president is to blame for the rise of political violence. In that case, Dems could sweep both houses and turn Trump into a piñata for the next two years, assuming he isn’t impeached and convicted before his term expires.

So a bandwagon of belief is rolling in that direction, but nobody need save me a seat. I’m not convinced the bomb suspect’s support for Trump will swing the election or that the synagogue attack helps Democrats.

Here are three main reasons for my doubts.

First, neither suspect was a solid citizen who suddenly turned to violence because of politics. Sayoc is a career criminal whose arrest record goes back three decades, including at least one charge for making terroristic threats.

A recent former employer described him as “crazed” but not about politics. He was, as The Post put it in a headline, a “stripper with a steroid problem.”

Bowers, based on what we know of him so far, is a freak of the fringe who would not be welcomed in any mainstream political party. His vileness isn’t partisan.

Although the public in general is distressed with gutter-level politics, and most feel Trump makes too many inflammatory comments, it doesn’t automatically follow that these two alleged criminals can be successfully pinned on the president. Just as most Americans did not blame Bernie Sanders when one of his supporters shot Republican Congressman Steve Scalise in a planned assassination attempt last year, most are more likely to believe Sayoc and Bowers are responsible for their own actions.

Second, the speed of events these days means no one storyline dominates for long, even in the anti-Trump-obsessed media. The Brett Kavanaugh confirmation battle looked as if it would determine the election — until the caravan of Central American immigrants making their way toward the southern border vowed to get into the country, one way or another.

Both events galvanized GOP voters and quashed most predictions of a blue wave. While it’s clear the media and Democrats will try to reverse the trend by hanging Sayoc and Bowers around Trump’s neck, that approach probably will work only with those already opposed to Trump.

Besides, the president’s supporters can — and already are — pointing to left-wing violence by antifa and comments by Hillary Clinton, Eric Holder, Maxine Waters and other Dems urging an uncivil campaign of harassment against Republicans.

And The New York Times didn’t help the left’s cause with its outrageous publication of an article that fantasizes about an assassination of the president. Shamefully, the Gray Lady’s demand for civility doesn’t extend to its own conduct.

The economy is the third reason for my doubts that last week will dramatically reshape the election. Most Americans in the workforce today have never seen anything like the jobs boom and the rising incomes that go with historic low unemployment.

To most voters, kitchen-table issues almost always outweigh headline-grabbing incidents, even horrible ones, a fact often lost on elite bubble dwellers. The media especially continue to fall hard for the illusion that the public trusts them to decide what matters most.

In short, I’m having that déjà vu feeling all over again. Much as they were in 2016, too many know-it-alls are 100 percent certain about which way the wind will blow on Nov. 6. The skeptic in me suspects they still are confusing facts with their own bias.

My only certainty now is the same one I had two years ago: Voters have a mind of their own.

Thank God for that.