(g) Any person who uses tear gas or tear gas weapons except in self-defense is guilty of a public offense and is punishable byimprisonment in a state prison for 16 months, or two or three years or in a county jail not to exceed one year or by a fine not to exceed one thousand dollars ($1,000), or by both the fine and imprisonment, except that, if the use is against a peace officer, as defined in Chapter 4.5 (commencing with Section 830) of Title 3 of Part 2, engaged in the performance of his or her official duties and the person committing the offense knows or reasonably should know that the victim is a peace officer, the offense is punishable by imprisonment in a state prison for 16 months or two or three years or by a fine of one thousand dollars ($1,000), or by both the fine and imprisonment.