Braves infielder Ramiro Pena considered trying to play with a torn labrum in his throwing shoulder rather than have season-ending surgery, but in the end determined it was best not to put off the inevitable.

The versatile veteran was to have surgery Thursday on his right (throwing) shoulder, performed by Dr. James Andrews at his Florida clinic. The rehabilitation period was expected to last about six months before Pena would be cleared for full baseball activities, similar to catcher Brian McCann’s rehab following October shoulder surgery.

The Braves didn’t provide an update following Thursday’s surgery.

Pena got opinions from at least two doctors before deciding Wednesday to go ahead and have the procedure. The fact that he doesn’t have a guaranteed contract for next season likely played into the decision. Pena will be arbitration-eligible and under contractual control of the Braves if they choose to retain him.

He was placed on the 15-day disabled list last week after rest didn’t alleviate discomfort that arose after making a pair of diving stops in a game two weeks ago. The Braves brought up Paul Janish from Triple-A Gwinnett to fill his spot, and it’s uncertain if they will look to replace Pena now that they know he’s out for the season.

Janish is as strong or stronger on defense as Pena, but doesn’t provide nearly as much offense as the Braves have gotten this season from the former Yankees infielder.

Pena is having a career-best season, batting .278 in 97 at-bats and already with career-highs in extra-base hits (nine) and home runs (three).

“Every team is going to have injuries,” Braves manager Fredi Gonzalez said. “The team that can survive those injuries is going to be there at the end. It’s an injury that (eliminates) some versatility, especially in a National League game, off the bench and pinch-hitting. But we have plenty of candidates that you feel comfortable could do that job.”

It will be the second surgery Pena has had on his throwing shoulder, which was first repaired seven years ago when he was a minor leaguer.