Former Democratic Rep. Barney Frank said Pete Buttigieg’s sexuality is a benefit to his 2020 presidential campaign.

Frank, who came out in 1987, becoming the first openly gay member of Congress, attributed Buttigieg being gay to his recent rise in the polls.

“His being gay is an advantage and, if he were straight, I don’t think he would be doing as well,” Frank told the Boston Globe.

[Related: Brother of Buttigieg's husband: 'I just don't support the gay lifestyle']

“It attracts attention to him and he gets points for being open and honest and gives people a chance to affirm their lack of prejudice,” said Frank, who served in the House 1981-2013. “I think Beto O’Rourke may be regretting that he’s straight.”

Buttigieg, 37, would be the first openly gay president if he makes it to the White House.

A RealClearPolitics average of polling data shows the South Bend, Ind., mayor trailing former Vice President Joe Biden, Sen. Bernie Sanders, I-Vt., and Sen. Elizabeth Warren, D-Mass.

Sen. Kamala Harris, D-Calif., is behind Buttigieg and ahead of O’Rourke, a former Texas Democratic congressman, in the average of polls.

Buttigieg married his husband, Chasten, in 2018.