§ 348. (§ 342.) Carrying of deadly weapons at courts, etc. Whoever shall carry about his person any dirk, bowie-knife, pistol or revolver, or any kind of deadly weapon, to or while at a court of justice or an election ground or precinct, or any place of public worship, or any other public gathering in this State, except militia muster grounds, shall be punished as for a misdemeanor. This section shall not apply to a sheriff, deputy sheriff, coroner, constable, marshal, policeman, or other arresting officer, or their posse, acting in the discharge of their official duties.