President Trump took French President Emmanuel Macron’s Iran gambit in stride as the G-7 Summit wound to a close — probably because Trump saw that Macron’s real game was pure politics.

The Frenchman’s policies have sent his own approval ratings into the tank. Nearly retired German Chancellor Angela Merkel’s coalition is on life support; Canadian Premier Justin Trudeau is reeling from a corruption scandal. Italy’s Giuseppe Conte announced his resignation days before the summit opened; Britain’s Boris Johnson just took over as prime minister and holds a paper-thin majority.

Japan’s Shinzo Abe is the only G-7 leader whose grip on power back home might be stronger than Trump’s — and he announced a trade deal with Washington during the meetings.

So the idea that the gathering would set any long- or even short-term common policy for the world’s wealthiest nations was always a fiction, however much the media sought to paint it as another round of “world appalled by Trump.”

Macron, this year’s host, originally wanted the summit to center on climate change and inequality. But those are the very issues killing him with French voters, hence his shift to pretending to try to resurrect the Iran deal on the sidelines.

Whatever heads-up the French president gave the American one about his invitation to Iranian Foreign Minister Mohammed Zarif, the stunt was never going anywhere: Macron and his allies have already consulted to death with Tehran about ways to salvage the accord, even as Washington has shown it can keep tightening the screws despite the appeasers’ best efforts.

Trump has also defeated Iran’s efforts to provoke open conflict, finessing Tehran’s shootdown of a US drone and its seizure of various oil tankers. Yet Macron still sought to paint the American as a warmonger by reaching out to Zarif as if the central problem were Washington’s refusal to negotiate, rather than its insistence on a deal that actually stops Iran from joining the nuclear club.

Bottom line: Macron was playing domestic politics, but Trump turned statesman by refusing to go ballistic over the empty gesture. How about that.