Part I. General Provisions
Chapter 3. Conditions governing criminal liability
Section 48.
No person may be punished for an act committed in self-defence.
It is a case of self-defence when an otherwise criminal act is committed for the prevention of or in defence against an unlawful attack if the act does not exceed what appeared to be necessary for that purpose, and it must not be considered absolutely unfitting to inflict so great an evil as is intended by the act in view of the dangerousness of the attack, the guilt of the assailant, or the legal right assailed.
The above provision concerning the prevention of an unlawful attack is also applicable to acts performed for the purpose of effecting a lawful arrest or preventing a prisoner from escaping from prison or custody.
If any person has exceeded the limits of self-defence, he shall nevertheless not be liable to a penalty if such excess is due solely to emotional upset or consternation caused by the attack.
EDIT.