Then either change the method to raise a more specific exception, or at least catch Exception, don't use a bare except.