Look closer - code is not the same. Only first 5 lines are almost the same, and these 5 lines would become 2 lines if python had ruby-like rescue statement :(