(a) An act or omission that is punishable in different ways by different provisions of law shall be punished under the provision that provides for the longest potential term of imprisonment, but in no case shall the act or omission be punished under more than one provision. An acquittal or conviction and sentence under any one bars a prosecution for the same act or omission under any other.
(b) Notwithstanding subdivision (a), a defendant sentenced pursuant to subdivision (a) shall not be granted probation if any of the provisions that would otherwise apply to the defendant prohibits the granting of probation.
(Amended by Stats. 1997, Ch. 410, Sec. 1. Effective January 1, 1998.)