After walking a mile in Sarah Palin’s pumps, actress Julianne Moore has sympathy for the former Alaska governor.

“I do think the situation that she was put in was a completely untenable one,” said Moore (far right), who matched the look of the one-time vice-presidential candidate (near right) — down to her trademark glasses — to play Sarah in the upcoming HBO movie “Game Change.”

Palin burst onto the national scene when Sen. John McCain plucked her from Alaskan obscurity to be his running mate in 2008. The film, written by Danny Strong and co-starring Ed Harris as McCain, focuses on Palin’s sudden rise to popularity — and her refusal to toe the political line. It is set to air on March 10.

The former governor went from having a comfortable and “open relationship” with the media in her home state to being manhandled by McCain’s people, Moore told The Post.

She “was suddenly almost in lockdown, where [she] wasn’t allowed to speak to anybody unless it went through the proper channels. They were telling her what to do and how to dress. And how to behave,” Moore said. “So they take a candidate for what she is and what she represents, and they want to make her into something else.”

Palin’s knowledge of world affairs and foreign policy was so limited that she had be given History 101 classes by McCain’s advisers — but that, Moore says, doesn’t mean Palin is dumb.

“People did see that she was not as prepared as they would have liked her to be. And they saw it in the various interviews that we all saw,” the actress said.

Still, “I think she’s very canny,” Moore said. “ And she’s extremely hardworking and ambitious, and would not have reached the place that she reached without ability. You don’t get to be a vice-presidential candidate by accident.”

Moore listened to Palin’s book “Going Rogue” on tape to master her Alaskan lilt.

“It’s not just her accent,” Moore said. “It’s almost her syntax, sometimes her phraseology. Instead of saying ‘to go out,’ she’ll say, ‘TO go out.’ There’s a musicality to her speech that’s very idiosyncratic.”