Any person who votes or attempts to vote at any primary or election, knowing that he does not possess all the qualifications of an elector at such primary or election, as set forth in this act, shall be guilty of a misdemeanor of the first degree, and, upon conviction thereof, shall be sentenced to pay a fine not exceeding ten thousand ($10,000) dollars, or to undergo an imprisonment of not more than five (5) years, or both, in the discretion of the court.
25 P.S.§ 3533