In case of the death or resignation of any member of the legislature, either senator or assemblyman, the county commissioners of the county from which such member was elected shall appoint a person of the same political party as the party which elected such senator or assemblyman to fill such vacancy; provided, that this section shall apply only in cases where no biennial election or any regular election at which county officers are to [be] elected takes place between the time of such death or resignation and the next succeeding session of the legislature.