Any person who compares the number on the ballot with the poll list shall be guilty of a misdemeanor, and, on conviction, shall be fined not less than $100.00; but this shall not apply on the trial of any contested elections.