A person who endeavours to resist or prevent the execution of the law by resisting the lawful arrest of himself or herself or of any other person for any cause other than a crime is liable on conviction on indictment to imprisonment for 2 years.