Section 42. In cities or towns where the aldermen or selectmen determine the question of holding state primaries by wards, precincts or groups of precincts, they shall give notice of their determination to the state secretary on or before June first; except that in the case of primaries before special elections they shall give such notice at least twenty-one days before the primaries.