At a time when our political system is said to be incapable of rising above poisonous partisanship to promote the national interest, Gen. David Petraeus’s visit to Capitol Hill last week was instructive.

What — you didn’t know Petraeus was in town for make-or-break hearings on President Obama’s Afghanistan policy? Well, in a way that proves the point.

In September 2007 Petraeus returned from Baghdad at a comparable moment in the Iraq war. The week he was in town Iraq filled 42 percent of the newshole monitored by the Pew Research Center’s News Coverage Index — mostly with stories that Petraeus is unlikely to want in his scrapbook.

A full-page ad branded him “General Betray Us.” Protesters jeered him and the U.S. ambassador to Iraq, Ryan Crocker. Then-Sen. Hillary Clinton said that Petraeus’s claims of progress were not credible.

Like Iraq then, the Afghanistan war today is unpopular; the president has ordered a surge in U.S. troops that has aroused skepticism; and most Americans want U.S. troops home.

Yet Petraeus’s appearances last week, this time accompanied by Defense Undersecretary Michle Flournoy, could hardly have been more different.

The Democratic chairman of the Senate Armed Services Committee, Carl Levin (Mich.), kicked off the week by saying that Petraeus’s counterinsurgency strategy had been “instrumental in turning the tide in Afghanistan.” The panel’s ranking minority member, Sen. John McCain (R-Ariz.), agreed: “We are turning around the war in Afghanistan.”

On the House side it was the same story, but with the Republican going first. “Our forces have made significant gains in the past year and have reversed the Taliban’s tactical momentum,” said House Armed Services Committee Chairman Buck McKeon (R-Calif.). “I want to start by concurring with the chairman’s remarks about the progress that has been made in Afghanistan in the last year to 18 months,” said ranking Democrat Rep. Adam Smith (Wash.).

Many members went on to probe aspects of U.S. policy, often skeptically, just as you’d hope legislators would: about Afghan corruption, Pakistani instability, suicide prevention and brain-injury treatment, the war’s high cost in lives and money, and the perceived free-riding of allies. But the questioning was respectful and directed at improving U.S. policy, not proving that it had failed.

There are many reasons for the contrast. Historic events from Japan to Libya overshadow news from Kandahar. Petraeus’s success in Iraq, combined with his deft political touch, has made him as close to bulletproof as anyone can be in this town, and he obviously wasn’t counting on that alone; it was astonishing how many members seemed to have just returned from the front.

Most important, the progress in Afghanistan is real — but, then, that was true in Iraq in 2007 and had little impact on the political debate, when there was such bitterness between President George W. Bush and Democrats that Iraqi reality was almost irrelevant. Bush had played the “soft on homeland security” card mercilessly and effectively, and Democrats were looking for payback.

Obama’s escalation, when 73 percent of Americans want substantial numbers of troops brought home, would seem to open fertile ground to Republicans. But from their leaders on down, they haven’t sought to plow there. In this instance at least, politics really has stopped at the water’s edge.

Meanwhile, the president has cocooned his activist policy in minimalist rhetoric. He never speaks of victory or idealistic goals, certainly not for the Afghan people. When he announced the surge in December 2009, he simultaneously emphasized a July 2011 withdrawal. When he nudged that withdrawal clock to the end of 2014, there was no address to the nation marking the new emphasis.

There are costs to this reticence. It’s hard to build support for an unpopular war if you leave that job to Petraeus and Flournoy, as capable as both are. Already, Congress is threatening to reduce funding for the civilian side of U.S. efforts in Afghanistan and Iraq, which could undercut both missions.

On the other hand, by doing as much as he thinks necessary while talking as little as he thinks possible, Obama may make it easier for all kinds of politicians to stay on board — Republicans who vilify him in almost every other context and liberal Democrats who dislike the policy, whose supporters hate the policy and who therefore would rather talk about almost anything else.

It may not be exactly how textbooks say leaders are supposed to lead — and if you believe the war is a mistake, it’s a picture of democracy failing to respond. But if, like Obama, you believe we need “an enduring, long-term commitment to Afghanistan,” as Flournoy paraphrased last week, “having made the mistake historically of walking away and then paid a very dear price for that,” then it is reassuring to see that Washington can stick with something hard, in a bipartisan and civil way.

Given the alternative still fresh in his memory, that’s probably good enough for Petraeus as he flies back to the war this week.