I'm definitely no expert in writing idiomatic python, but it seems very wrong to execute a function just so that it could throw an exception.