I think you don't need to use an else block here, you can left the code untouched and just add the conditional to raise.