fix python3 try catch