Python Exception Handling In The correct Way