python try catch continue for loop