It’s a good thing he’s out of town on the campaign trial, because Mayor Bill de Blasio’s favorite gym is out of commission.

The Prospect Park YMCA in Park Slope — the one that de Blasio frequently travels 11 miles from Gracie Mansion to get to via motorcade — has been shuttered since July 2 because of a contaminated water supply.

The YMCA first announced that the water had become contaminated with ethylene glycol, which is found in antifreeze. But it later issued an update that the culprit was actually propylene glycol, which the Food and Drug Administration says is “generally recognized as safe” for use in food.

The substance got into the water when a vendor was conducting maintenance on the Y’s air conditioning system, according to the gym on Ninth Street’s website. The facility will remain closed on Friday.

Neither de Blasio’s office nor a spokeswoman for his campaign immediately responded to a request for comment — or to questions of where the mayor might take his workouts if the Y extends its closure.

Hizzoner, who spent the Fourth of July in Iowa working to improve his chances in his quixotic presidential run, has remained defiant in the face of criticism for his long rides to the Park Slope Y, saying that getting his workout there keeps him connected with his home neighborhood — though staffers for his presidential campaign have set up shop in a co-working space that’s just a few blocks from the Y.