Courts (and juries, by instruction) often take context into consideration when deciding things like this. Generally speaking, judges in Canada do not like people defending themselves if there were any other option to avoid getting harmed -- and judges have a lot of sway as to the outcome of a trial.