NEW YORK — White House hopeful Bernie Sanders took a parting shot at New York’s rule barring independents from voting in its Democratic primary as he prepared to leave the state Tuesday en route to campaign stops in Pennsylvania.

Aides to Sanders have been downplaying expectations for his performance here Tuesday against Hillary Clinton, citing the closed primary. Independents have tilted heavily toward Sanders in states where they are allowed to vote.

On a morning stroll around the block from the Times Square hotel where he was staying, Sanders ran into Michael Cantalupo, 21, a local television host, who told Sanders that he had missed the October deadline to switch his unaffiliated voting status to Democratic.

“This is the problem, tell them,” Sanders told Cantalupo, directing him to talk to more than a dozen reporters trailing the senator from Vermont on his walk.

“It shouldn’t be so hard,” Cantalupo said, summing up his failure to become a Democrat in time to cast a ballot for Sanders on Tuesday.

“That’s a very unfortunate thing, I know,” Sanders said.

Republican Donald Trump is favored to win in New York where a victory would give him a much-needed boost ahead of rival Ted Cruz. (Reuters)

Some 3 million independents in New York will be unable to vote in the primaries on Tuesday because of the rule, Sanders said, adding it’s something he’d like to see changed.

After circling the rest of the block, Sanders disappeared into his hotel and was soon on his way to the airport. He has two campaign stops planned Tuesday in Pennsylvania, which is one of five states holding primaries on April 26. Pennsylvania’s Democratic primary is closed, too.