He was a patriot, a hero, a ­genial gentleman and a great American. You can’t pick up a newspaper or go near a television without hearing leftists gush with praise for the late President George H.W. Bush. Who knew they felt this way?

And you are not mistaken if the outpouring of previously unknown affection for the first President Bush sounds familiar. That’s because it is almost identical to the loving send-off the same suspects gave Sen. John McCain after he died in August.

It all just goes to prove that Democrats and their media handmaidens really do love Republicans — when they’re dead. All the more so if, when they were alive, they ­opposed President Trump.

There were reports that both Bush and McCain voted for Hillary Clinton in 2016. See, good Republicans.

McCain’s feud went beyond the grave, when it became known that he did not want Trump at his funeral. McCain got extra love for that ­final bit of pettiness.

Paradoxically, Bush gets extra credit because he wanted Trump at his funeral, even though both gestures are seen as a rebuke to the current president. In this case, Bush is hailed for rising above pettiness.

There is another phony dimension in the media’s praise for Bush and McCain in that both were said to epitomize a less toxic time in politics. While it’s true that politics wasn’t always as vicious as it is now and that Democrats and Republicans actually socialized frequently, the mainstream media didn’t share in that bipartisan bonhomie when it came to coverage.

Even then, their bias tilted left, although their double standard has reached new depths in recent years. I believe the press corps’ lapdog approach to Barack Obama and attack-dog approach to Trump are part of why Americans have become so polarized.

Indeed, many Trump voters ­explain their support for him as a reaction to left-wing press bias and the failure of other Republicans to fight back the way Trump does.

The heydays of press hatred for Bush and McCain came during their presidential campaigns. Long before they were saluted for their late-in-life stances against Trump, Bush 41 and McCain were declared unfit to be president.

The New York Times, which last endorsed a Republican for president in 1956, backed the hapless Michael Dukakis over Bush in 1988, and Bush went on to win in a landslide, picking up more than 53 percent of the popular vote and 426 electoral votes.

Four years later, the paper supported Bill Clinton, ripping Bush’s economic management as “exasperating” and his positions on individual rights as “infuriating.” It accused him of stoking racial resentment, of going to “radical ­extremes” in supporting right-to-life measures, and said his “capacity to govern has collapsed.”

When Bush nominated Clarence Thomas to the Supreme Court in 1991, he and Thomas got the same kind of character smearing that Trump and Brett Kavanaugh got this year.

Now, in his coffin, Bush is a model of American greatness.

McCain likewise was hailed as a brave maverick in 2000 when he sought the GOP nomination against George W. Bush. But when he won the nomination in 2008 to run against Barack Obama, the Times said McCain had “retreated farther and farther to the fringe of American politics, running a campaign on partisan division, class warfare and even hints of racism. His policies and worldview are mired in the past.”

As he lay dead, the paper hailed the “adventurous bipartisanship” he demonstrated “in a long and distinguished career.”

The Washington Post, which has never endorsed a Republican for president, followed a similar trajectory: condemnation for McCain when he criticized Obama and other Dems, lavish praise when he turned fire on Republicans, especially Trump.

There is, of course, nothing wrong in saying something nice about the recently departed. Eulogies are not the time or place to seek balance.

The problem emerges when the partisan lens becomes the decisive factor in switching from damnation to praise. Then it is hypocrisy masquerading as principle and grace.

The flip-flops are the latest reminders that, more than two years after Trump’s stunning upset, it is not adequate to say American elites of both parties and the media have yet to accept his presidency. It is clear they never will.

Instead, they distort reality to make it fit their prejudice. They discover virtues in men they never supported only to use them as a cudgel against Trump.

Bush was elected in 1988 largely because he was seen as Ronald Reagan’s third term, and he was not an inspiring president, getting just 37 percent of the popular vote in 1992 in a three-way field, with Ross Perot getting 19 percent.

His post-presidential life was noteworthy mostly because his son also became president, and because he lived to 94.

Yet Jimmy Carter, another ex-president, is also 94, but even fellow Dems shun him, so he’s not seen as beloved or a national treasure by almost anyone.

As for McCain, his bitterness toward Trump was personal, dating to nasty remarks Trump made in 2015 about McCain’s five years of captivity and torture by the North Vietnamese. “He’s not a war hero. He’s a war hero because he was captured,” Trump said then. “I like people that weren’t captured.”

McCain did his best to get even, reportedly giving the phony Russian dossier on Trump to the FBI. That kind of payback, more than his military career or captivity, is what finally endeared him to the left.

A head(line) of lettuce

Headline of the week:

“Lettuce Try Not to Panic,” in the Wall Street Journal about government overreaction to an E. coli outbreak traced to romaine lettuce.

Putz can’t even swing ax straight

You could watch a lot of politics over many years and never see something like the latest screw-up by Mayor Bill de Blasio. Then again, there haven’t been many public officials like the Putz.

The mayor took his “Don’t bother me with details” habits to a new level with the attempt to fire the head of the city’s emergency management agency. When a deputy mayor asked Joseph Esposito for his resignation Friday, Esposito refused, saying only de Blasio could fire him. Naturally, the mayor was out of town and out of touch.

The standoff continued through the weekend — and wasn’t resolved by a Monday meeting between Esposito and the mayor. Finally, late Monday, City Hall said he would remain in the job until a replacement was found, at which point he would get another government post.

The ham-handed oddity is magnified because the stated reason for the firing is the city’s woeful response to the Nov. 15 snowstorm. But de Blasio said the city did nothing wrong, and the sanitation commissioner, whose agency was late in plowing and salting the streets, refuses to apologize.

So why was Esposito, who was also on vacation, picked to be the fall guy? Good question.

Perhaps the answer will come in a future episode about the mayor who doesn’t give a damn.