Just as we predicted, Mayor Bill de Blasio’s lawsuit against Big Oil was laughed out of federal court Thursday.

Echoing a West Coast jurist, who tossed a similar suit by San Francisco and Oakland last month, Manhattan federal Judge John Keenan ruled that his court is no place to craft climate-change policy.

De Blasio had sued Chevron, ExxonMobil, ConocoPhillips, Royal Dutch Shell and BP, saying they harmed the city by stoking global warming and sparking Superstorm Sandy. He sought billions in damages.

The notion was always nutty, and Keenan wouldn’t buy it: “The immense and complicated problem of global warming requires a comprehensive solution that weighs the global benefits of fossil fuel use with the gravity of the impending harms,” he said. It’s up to Congress and the executive branch to find that solution, not the courts.

That makes sense. Indeed, even Team de Blasio seems to believe fossil fuel’s benefits outstrip its costs, since it continues to buy gas and oil for city-owned vehicles and buildings, while it is presumably fully aware of the consequences.

Hizzoner himself keeps racing around in SUVs and taking fuel-guzzling flights to grandstand at the Mexican border or take in Red Sox spring training games in Florida. Isn’t it a tad hypocritical to sue the producers of something you keep buying?

Of course, it’s not likely the mayor really expected to win this case — or to end the use of fossil fuels anytime soon, given there’s no real alternative. No, as usual it was all about virtue-signaling and pretending to champion a progressive cause.

In the end, though, de Blasio’s bid backfired: Instead of looking like a climate-change hero, he simply looks ridiculous.