Section 2. An officer who arrests or takes into or detains in custody a person, pretending to have a process if he has none, or pretending to have a different process from that which he has, shall be punished by a fine of not more than one thousand dollars or by imprisonment for not more than one year.