python try catch generic exception